X-Git-Url: http://git.pjr.cc/?p=gwvp.git;a=blobdiff_plain;f=gwvplib%2Fgwvpauth.php;h=5056c061832206075f73f93914035aa5b298bbbd;hp=f7e036d2d1bebeb732ecd70f5ba5def7ce9383b7;hb=20d1cc1a856b039329b382a8119454099896c938;hpb=c7bb18886251e5187afbdb8d2101e200eb895ab6 diff --git a/gwvplib/gwvpauth.php b/gwvplib/gwvpauth.php index f7e036d..5056c06 100644 --- a/gwvplib/gwvpauth.php +++ b/gwvplib/gwvpauth.php @@ -9,10 +9,15 @@ function gwvp_AuthCallMe() session_start(); if(isset($_REQUEST["q"])) { - $query = $_REQUEST["q"]; - if($query == "login") return "gwvp_AuthHandleLogin"; - if($query == "logout") return "gwvp_AuthHandleLogout"; - if($query == "register") return "gwvp_RegistrationCall"; + $query = explode("/", $_REQUEST["q"]); + if($query[0] == "login") return "gwvp_AuthHandleLogin"; + if($query[0] == "logout") return "gwvp_AuthHandleLogout"; + if($query[0] == "register") { + if(isset($query[1])) { + return "qwvp_attemptRegistration"; + } + return "gwvp_RegistrationCall"; + } } $login = gwvp_isLoggedIn(); @@ -117,9 +122,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 { @@ -134,13 +141,24 @@ function gwvp_AuthHandleLogin() function gwvp_RegistrationPageBody() { + global $BASE_URL; + + // TODO: registration page needs to be prettier - mostly the image for the captcha + ?> -