/************************** * MantisBT Path Settings * **************************/ if ( isset ( $_SERVER['SCRIPT_NAME'] ) ) { $t_protocol = 'http'; if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ) { $t_protocol= $_SERVER['HTTP_X_FORWARDED_PROTO']; } else if ( isset( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) ) { $t_protocol = 'https'; } # $_SERVER['SERVER_PORT'] is not defined in case of php-cgi.exe if ( isset( $_SERVER['SERVER_PORT'] ) ) { $t_port = ':' . $_SERVER['SERVER_PORT']; if ( ( ':80' == $t_port && 'http' == $t_protocol ) || ( ':443' == $t_port && 'https' == $t_protocol )) { $t_port = ''; } } else { $t_port = ''; } if ( isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) { // Support ProxyPass $t_hosts = explode( ',', $_SERVER['HTTP_X_FORWARDED_HOST'] ); $t_host = $t_hosts[0]; } else if ( isset( $_SERVER['HTTP_HOST'] ) ) { $t_host = $_SERVER['HTTP_HOST']; } else if ( isset( $_SERVER['SERVER_NAME'] ) ) { $t_host = $_SERVER['SERVER_NAME'] . $t_port; } else if ( isset( $_SERVER['SERVER_ADDR'] ) ) { $t_host = $_SERVER['SERVER_ADDR'] . $t_port; } else { $t_host = 'mantis'; } $t_path = str_replace( basename( $_SERVER['PHP_SELF'] ), '', $_SERVER['PHP_SELF'] ); $t_path = basename( $t_path ) == "admin" ? dirname( $t_path ) . DIRECTORY_SEPARATOR : $t_path; $t_path = basename( $t_path ) == "soap" ? dirname( dirname( $t_path ) ) . DIRECTORY_SEPARATOR : $t_path; $t_url = $t_protocol . '://' . $t_host . $t_path; } else { $t_path = ''; $t_host = ''; $t_protocol = ''; }