From aa0f70e78032d5c5a8e8223e76661de97d7ec3de Mon Sep 17 00:00:00 2001 From: oweissbarth Date: Sun, 16 Mar 2014 22:00:34 +0100 Subject: Added more error cases to register ui --- www/register.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'www/register.php') diff --git a/www/register.php b/www/register.php index 05bed6e..aa5dffe 100755 --- a/www/register.php +++ b/www/register.php @@ -2,12 +2,6 @@ /* Displays the register page and possible errors. Users specify their username and password and email address to register. As this page is invite-only users must enter their invite-key aswell. - TODO the email cannot differ from the address the mail was sent to. --that's fine and should be - - TODO Username is not checked for duplicates. --fix 16.3.2014 - - TODO invites should have it's own error. --fix 16.3.2014 - It has already been checked that the user isn't already logged in. $case can have the following values: @@ -31,11 +25,11 @@ function print_register($case){ include("static/header.html"); - $username = (isset($_POST["username"]))? $_POST["username"] : ""; + $username = (isset($_POST["username"]) && $case != REGISTER_USERNAME)? $_POST["username"] : ""; $email = (isset($_POST["email"]) && $case != REGISTER_EMAIL)? $_POST["email"] : ""; - $invite_key = isset($_POST["key"])? $_POST["key"] : ""; + $invite_key = (isset($_POST["key"]) && $case != REGISTER_INVITEKEY)? $_POST["key"] : ""; $message = ""; @@ -45,7 +39,7 @@ function print_register($case){ '; break; case(REGISTER_DATABASE): - $message = '