From 07297d606d209aa4d70d25fe9d72d80e1131c19e Mon Sep 17 00:00:00 2001 From: oweissbarth Date: Sun, 16 Mar 2014 20:21:32 +0100 Subject: Added print_register --- www/functions/func_register.php | 2 +- www/include.php | 1 + www/register.php | 87 +++++++++++++++++++++++------------------ 3 files changed, 52 insertions(+), 38 deletions(-) diff --git a/www/functions/func_register.php b/www/functions/func_register.php index 252467b..8321339 100755 --- a/www/functions/func_register.php +++ b/www/functions/func_register.php @@ -30,7 +30,7 @@ function register($db){ $test_key = $test_key_ar[0]; if (empty($test_status_ar) || $test_status_int != 0 || $test_key != $_POST["key"] || $test_key == ""){ - return REGISTER_PROHOBITED; + return REGISTER_PROHIBITED; } $id_db = $db->query("SELECT id FROM user WHERE email='" . $safe_email . "';"); diff --git a/www/include.php b/www/include.php index 3a79919..3374574 100755 --- a/www/include.php +++ b/www/include.php @@ -15,4 +15,5 @@ require_once($func_dir . "func_user.php"); // gets the userid and account speci require_once($func_dir . "func_content.php"); // get the vfs content require_once("login.php"); +require_once("register.php"); diff --git a/www/register.php b/www/register.php index 71bd87b..0981c20 100755 --- a/www/register.php +++ b/www/register.php @@ -4,65 +4,78 @@ TODO the email cannot differ from the address the mail was sent to. + TODO Username is not checked for duplicates. + + TODO invites should have it's own error. + It has already been checked that the user isn't already logged in. - $_GET["reason"] can have the following values: + $case can have the following values: - password: Specifies that the password wasn't the same in both fields. The user is not registered. - - database: Specifies that the request could not be fullfilled due to a database error. The user is not registered. - - encoding: Specifies that the request could not be fullfilled due to invalid symbols in the password. TODO we should support the whole UTF-8 - - prohibited: Specifies that the request could not be fullfilled because the account has been marked "blocked" + REGISTER_PASSWORD: Specifies that the password wasn't the same in both fields. The user is not registered. - TODO success? + REGISTER_DATABASE: Specifies that the request could not be fullfilled due to a database error. The user is not registered. - TODO provide the entered data if an error occurred. + REGISTER_EMAIL: Specifies that the request could not be fullfilled due to invalid symbols in the password. - TODO username? + REGISTER_PROHIBITED: Specifies that the request could not be fullfilled because the account has been marked "blocked" - TODO email? - TODO invite-key? - ================================================================================================================================================== +================================================================================================================================================== */ -?> - - - +function print_register($case){ + include("static/header.html"); -