]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16919 removing extra validation for extended username characters. PARAM_USERNAME...
authorRossiani Wijaya <rossianiwijaya@gmail.com>
Wed, 13 Jan 2010 09:33:08 +0000 (09:33 +0000)
committerRossiani Wijaya <rossianiwijaya@gmail.com>
Wed, 13 Jan 2010 09:33:08 +0000 (09:33 +0000)
login/index.php
login/signup_form.php

index 0ee8371e41454edc44cf4f30caf51aa607960e24..c5c97d9146e2f3a1248f5c90c137ebc207996037 100644 (file)
@@ -104,12 +104,11 @@ if (empty($CFG->usesid) and $testcookies and (get_moodle_cookie() == '')) {    /
 
     $frm->username = trim(moodle_strtolower($frm->username));
 
-    if (is_enabled_auth('none') && empty($CFG->extendedusernamechars)) {
+    if (is_enabled_auth('none') ) {
         $string = clean_param($frm->username, PARAM_USERNAME);
         if (strcmp($frm->username, $string)) {
             $errormsg = get_string('username').': '.get_string("invalidusername");
             $errorcode = 2;
-
             $user = null;
         }
     }
index 2ce7ebbc55cd29e720f19a98a892d457562d7a21..0e7b03ee2e22609f4cc07bf926c170b24497e0d3 100644 (file)
@@ -103,13 +103,12 @@ class login_signup_form extends moodleform {
             //check allowed characters
             if ($data['username'] !== moodle_strtolower($data['username'])) {
                 $errors['username'] = get_string('usernamelowercase');
-            } else {
-                if (empty($CFG->extendedusernamechars)) {
-                    $string = clean_param($data['username'], PARAM_USERNAME);
-                    if (strcmp($data['username'], $string)) {
-                        $errors['username'] = get_string('invalidusername');
-                    }
+            } else {                
+                $string = clean_param($data['username'], PARAM_USERNAME);
+                if (strcmp($data['username'], $string)) {
+                    $errors['username'] = get_string('invalidusername');
                 }
+                
             }
         }