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 + ?> -
+ + @@ -152,6 +170,8 @@ function gwvp_RegistrationPageBody() + + @@ -160,6 +180,24 @@ function gwvp_RegistrationPageBody() check($_POST['captcha_code']) == false) { + // the code was incorrect + // you should handle the error so that the form processor doesn't continue + + // or you can use the following code if there is no validation or you do not know how + echo "The security code entered was incorrect.

"; + echo "Please go back and try again."; + } else { + echo "code was right"; + } + + } +} + function gwvp_checkBasicAuthLogin() { $user = false;
Name Your Full Name + + CAPTCHA Image
+ + [ Different Image ] + +
Email The Name Used to Refer to you on the site