From 0305fe824d8abf5b7249a5ca8f2ba045c1e8413b Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 1 Apr 2003 02:24:58 +0000 Subject: [PATCH] Undoing recent changes --- login/index.php | 1 - login/signup.php | 63 ++++++++++++++++++++++++------------------------ 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/login/index.php b/login/index.php index d6f395133a..297d3e9fdd 100644 --- a/login/index.php +++ b/login/index.php @@ -21,7 +21,6 @@ if ($frm = data_submitted()) { - $frm->username = strtolower($frm->username); $user = authenticate_user_login($frm->username, $frm->password); update_login_count(); diff --git a/login/signup.php b/login/signup.php index a2b793a11a..8bab6c76c5 100644 --- a/login/signup.php +++ b/login/signup.php @@ -1,31 +1,30 @@ auth/lib.php"); - if ($user = data_submitted()) { - $user->username= strtolower($user->username); - validate_form($user, $err); + if ($user = data_submitted()) { + validate_form($user, $err); - if (count((array)$err) == 0) { - $plainpass = $user->password; + if (count((array)$err) == 0) { + $plainpass = $user->password; $user->password = md5($user->password); $user->confirmed = 0; $user->lang = current_language(); $user->firstaccess = time(); $user->secret = random_string(15); if (isset($CFG->auth_user_create) and $CFG->auth_user_create==1 and function_exists('auth_user_create') ){ - if (! auth_user_exists($user->username)) { - if (! auth_user_create($user,$plainpass)) { - error("Could not add user to authentication module!"); + if (! auth_user_exists($user->username)) { + if (! auth_user_create($user,$plainpass)) { + error("Could not add user to authentication module!"); } - } else { - error("User already exists on authentication database."); + } else { + error("User already exists on authentication database."); } } - if (! ($user->id = insert_record("user", $user)) ) { + if (! ($user->id = insert_record("user", $user)) ) { error("Could not add your record to the database!"); } @@ -34,16 +33,16 @@ if (! send_confirmation_email($user)) { error("Tried to send you an email but failed!"); } - + $emailconfirm = get_string("emailconfirm"); - print_header($emailconfirm, $emailconfirm, $emailconfirm); + print_header($emailconfirm, $emailconfirm, $emailconfirm); echo "
"; print_string("emailconfirmsent", "", $user->email); echo "
"; print_footer(); - exit; - } - } + exit; + } + } if (!empty($err)) { $focus = "form.".array_shift(array_flip(get_object_vars($err))); @@ -63,8 +62,8 @@ $langmenu = popup_form ("$CFG->wwwroot/login/signup.php?lang=", $langs, "chooselang", $currlang, "", "", "", true); - print_header($newaccount, $newaccount, "$login -> $newaccount", $focus, "", true, "
$langmenu
"); - include("signup_form.php"); + print_header($newaccount, $newaccount, "$login -> $newaccount", $focus, "", true, "
$langmenu
"); + include("signup_form.php"); print_footer(); @@ -75,8 +74,8 @@ function validate_form($user, &$err) { global $CFG; - if (empty($user->username)) - $err->username = get_string("missingusername"); + if (empty($user->username)) + $err->username = get_string("missingusername"); else if (record_exists("user", "username", $user->username)) $err->username = get_string("usernameexists"); @@ -89,13 +88,13 @@ function validate_form($user, &$err) { if (isset($CFG->auth_user_create) and $CFG->auth_user_create==1 and function_exists('auth_user_exists') ){ if (auth_user_exists($user->username)) { - $err->username = get_string("usernameexists"); - } - } + $err->username = get_string("usernameexists"); + } + } - if (empty($user->password)) - $err->password = get_string("missingpassword"); + if (empty($user->password)) + $err->password = get_string("missingpassword"); if (empty($user->firstname)) $err->firstname = get_string("missingfirstname"); @@ -109,16 +108,16 @@ function validate_form($user, &$err) { else if (! validate_email($user->email)) $err->email = get_string("invalidemail"); - + else if (record_exists("user", "email", $user->email)) - $err->email = get_string("emailexists")." ".get_string("newpassword")."?"; + $err->email = get_string("emailexists")." ".get_string("newpassword")."?"; - if (empty($user->city)) - $err->city = get_string("missingcity"); + if (empty($user->city)) + $err->city = get_string("missingcity"); - if (empty($user->country)) - $err->country = get_string("missingcountry"); + if (empty($user->country)) + $err->country = get_string("missingcountry"); return; } -- 2.39.5