reaplced the git service code (main gitbackendinterface()) with a new
[gwvp.git] / gwvplib / gwvpauth.php
index ad42b2b..086af98 100644 (file)
@@ -40,7 +40,6 @@ 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; 
 }
 
@@ -59,12 +58,6 @@ function gwvp_CheckAuthLevel($levels)
        return false;
 }
 
-function gwvp_fourZeroThree()
-{
-       header("HTTP/1.0 403 Permission Denied");
-       exit(0);
-}
-
 function gwvp_AuthNoPerms()
 {
        gwvp_goMainPage("gwvp_AuthNoPermsBody");
@@ -122,9 +115,11 @@ function gwvp_AuthHandleLogin()
                gwvp_SendMessage("error", "Login Failed");
                header("Location: $BASE_URL");
        } else {
+               $details = gwvp_getUser($user);
                $_SESSION["isloggedin"] = true;
                $_SESSION["username"] = "$user";
                $_SESSION["fullname"] = $details["fullname"];
+               $_SESSION["id"] = $details["id"];
                if(gwvp_IsUserAdmin($details["email"])) {
                        $_SESSION["usertype"] = "admin";
                } else {
@@ -227,7 +222,7 @@ function gwvp_SingleLineLoginForm()
        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>";
 }