summaryrefslogtreecommitdiff
path: root/www/register.php
diff options
context:
space:
mode:
authorHorus32014-03-16 22:28:03 +0100
committerHorus32014-03-16 22:28:03 +0100
commit1e526e476e75c936b4229914d63b7ef91aa4a790 (patch)
tree48372996254dcc6842a34f0f0eed8fee3e515ddc /www/register.php
parent3cbe01ea7df2f628e767b7b00e7c1612062c05ab (diff)
parentaa0f70e78032d5c5a8e8223e76661de97d7ec3de (diff)
downloadfiles.iamfabulous.de-1e526e476e75c936b4229914d63b7ef91aa4a790.tar.gz
merge
Diffstat (limited to 'www/register.php')
-rwxr-xr-xwww/register.php20
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;
}