diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 1737dbf970a..5856d4bac4d 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -483,7 +483,9 @@ function get_moodle_cookie() { function create_user_record($username, $password) { /// Creates a bare-bones user record global $REMOTE_ADDR, $CFG; - + + $username = strtolower($username); + if (function_exists(auth_get_userinfo)) { if ($newinfo = auth_get_userinfo($username)) { foreach ($newinfo as $key => $value){ diff --git a/login/index.php b/login/index.php index 80e975004fa..d6f395133ab 100644 --- a/login/index.php +++ b/login/index.php @@ -21,7 +21,7 @@ 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 f5f9b3285fa..a2b793a11a3 100644 --- a/login/signup.php +++ b/login/signup.php @@ -5,7 +5,7 @@ require_once("../auth/$CFG->auth/lib.php"); if ($user = data_submitted()) { - + $user->username= strtolower($user->username); validate_form($user, $err); if (count((array)$err) == 0) { @@ -74,7 +74,7 @@ *****************************************************************************/ function validate_form($user, &$err) { - global $CFG; + global $CFG; if (empty($user->username)) $err->username = get_string("missingusername"); diff --git a/user/edit.php b/user/edit.php index 43174b690f8..4f42084c2b5 100644 --- a/user/edit.php +++ b/user/edit.php @@ -43,7 +43,7 @@ /// If data submitted, then process and store. if ($usernew = data_submitted()) { - + $usernew->username = strtolower($usernew->username); $usernew->firstname = strip_tags($usernew->firstname); $usernew->lastname = strip_tags($usernew->lastname);