function gwvp_AskForBasicAuth()
{
- if(!isset($_SERVER["PHP_AUTH_USER"])) {
- header('WWW-Authenticate: Basic realm="My Realm"');
- header('HTTP/1.0 401 Unauthorized');
- exit(0);
- } else return;
+ header('WWW-Authenticate: Basic realm="GIT Repo"');
+ header('HTTP/1.1 401 Unauthorized');
}
// $levels is checked against $LOGIN_TYPE, levels can be either just "admin" or admin,user anon,user anon, etc.
return false;
}
-function gwvp_fourZeroThree()
-{
- header("HTTP/1.0 403 Permission Denied");
- exit(0);
-}
-
function gwvp_AuthNoPerms()
{
gwvp_goMainPage("gwvp_AuthNoPermsBody");
$pass = $_SERVER["PHP_AUTH_PW"];
} else return false;
- return gwvp_authUserPass($user, $pass);
+ error_log("passing basic auth for $user, $pass to backend");
+ $auth = gwvp_authUserPass($user, $pass);
+ if($auth !== false) {
+ error_log("auth passes");
+ } else {
+ error_log("auth failes");
+ }
+
+ return $auth;
}
function gwvp_IsLoggedIn()
echo "<form method=\"post\" action=\"$BASE_URL/login\">Username <input type=\"text\" name=\"username\" class=\"login\">";
echo " Passowrd <input type=\"text\" name=\"password\" class=\"login\"><input type=\"submit\" name=\"login\" value=\"Login\" class=\"loginbutton\">";
if(gwvp_IsRegistrationEnabled()) echo "<a href=\"$BASE_URL/register\">Register</a></form>";
- else echo "</form>";
+ else echo "</form><br>";
}