Exemplo n.º 1
0
         }
         function SetStatus($status)
         {
             $bCgi = stristr(php_sapi_name(), "cgi") !== false;
             $bFastCgi = $bCgi && (array_key_exists('FCGI_ROLE', $_SERVER) || array_key_exists('FCGI_ROLE', $_ENV));
             if ($bCgi && !$bFastCgi) {
                 header("Status: " . $status);
             } else {
                 header($_SERVER["SERVER_PROTOCOL"] . " " . $status);
             }
         }
         if ($_REQUEST['done']) {
             echo 'SUCCESS';
         } else {
             SetStatus("302 Found");
             $protocol = IsHTTPS() ? "https" : "http";
             $host = $_SERVER['HTTP_HOST'];
             if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 && $_SERVER['SERVER_PORT'] > 0 && strpos($_SERVER['HTTP_HOST'], ":") === false) {
                 $host .= ":" . $_SERVER['SERVER_PORT'];
             }
             $url = "?redirect_test=Y&done=Y&unique_id=" . checker_get_unique_id();
             header("Request-URI: " . $protocol . "://" . $host . $url);
             header("Content-Location: " . $protocol . "://" . $host . $url);
             header("Location: " . $protocol . "://" . $host . $url);
             exit;
         }
         break;
     default:
         break;
 }
 if ($fix_mode = intval($_GET['fix_mode'])) {
Exemplo n.º 2
0
			function SetStatus($status)
			{
				$bCgi = (stristr(php_sapi_name(), "cgi") !== false);
				$bFastCgi = ($bCgi && (array_key_exists('FCGI_ROLE', $_SERVER) || array_key_exists('FCGI_ROLE', $_ENV)));
				if($bCgi && !$bFastCgi)
					header("Status: ".$status);
				else
					header($_SERVER["SERVER_PROTOCOL"]." ".$status);
			}

			if ($_REQUEST['done'])
				echo 'SUCCESS';
			else
			{
				SetStatus("302 Found");
				$protocol = (IsHTTPS() ? "https" : "http");
				$host = $_SERVER['HTTP_HOST'];
				if($_SERVER['SERVER_PORT'] <> 80 && $_SERVER['SERVER_PORT'] <> 443 && $_SERVER['SERVER_PORT'] > 0 && strpos($_SERVER['HTTP_HOST'], ":") === false)
					$host .= ":".$_SERVER['SERVER_PORT'];
				$url = "?redirect_test=Y&done=Y&unique_id=".checker_get_unique_id();
				header("Request-URI: ".$protocol."://".$host.$url);
				header("Content-Location: ".$protocol."://".$host.$url);
				header("Location: ".$protocol."://".$host.$url);
				exit;
			}
		break;
		default:
		break;
	}

	if ($fix_mode = intval($_GET['fix_mode']))
function RedirectIfIsHTTPS($OnFalse)
{
    if (IsHTTPS()) {
        header("Location: " . $OnFalse);
    }
}