blob: 4c5cc74633670a599ab015259c5fbdd0774c1c4a [file] [log] [blame]
<?php
// prompt for login if not already present
if (!strlen($_SERVER["PHP_AUTH_USER"]) || !strlen($_SERVER["PHP_AUTH_PW"]))
{
header("WWW-Authenticate: Basic realm=\"http/tests/misc/authentication-redirect-2\"");
header("HTTP/1.0 401 Unauthorized");
exit;
}
// do redirect if called for
$redirect_codes=array("301", "302", "303", "307");
if (in_array($_GET["redirect"], $redirect_codes))
{
header("Location: http://127.0.0.1:8000/misc/authentication-redirect-2/resources/auth-echo.php", true, $_GET["redirect"]);
exit;
}
echo "Unknown redirect parameter sent";
?>