diff options
| author | oweissbarth | 2014-03-16 22:00:34 +0100 |
|---|---|---|
| committer | oweissbarth | 2014-03-16 22:00:34 +0100 |
| commit | aa0f70e78032d5c5a8e8223e76661de97d7ec3de (patch) | |
| tree | f387f33301b8ef86b70138ae5126f5d360ee95bf /www/register.php | |
| parent | 0665ea1e03f2bbb269e33ab78e4271eabe8f6442 (diff) | |
| download | files.iamfabulous.de-aa0f70e78032d5c5a8e8223e76661de97d7ec3de.tar.gz | |
Added more error cases to register ui
Diffstat (limited to 'www/register.php')
| -rwxr-xr-x | www/register.php | 20 |
1 files changed, 11 insertions, 9 deletions
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 = '<h1 id="register-error">Activation of your account is prohibited</h1> + $message = '<h1 id="register-error">Internal Error. Please contact admin</h1> '; break; case(REGISTER_EMAIL): @@ -56,6 +50,14 @@ function print_register($case){ $message = '<h1 id="register-error">Activation of your account is prohibited</h1> '; break; + case(REGISTER_INVITEKEY): + $message = '<h1 id="register-error">Your invite-key is not correct.</h1> + '; + break; + case(REGISTER_USERNAME): + $message = '<h1 id="register-error">This username is already in use</h1> + '; + break; } |
