Ticket #146: 20charusername.diff
| File 20charusername.diff, 4.0 kB (added by ewout, 1 year ago) |
|---|
-
mod/community/lib/communities_actions.php
old new 20 20 $comm_username = optional_param('comm_username'); 21 21 if (logged_on && !empty($comm_name) && !empty($comm_username) && 22 22 ($CFG->community_create_flag == "" || user_flag_get($CFG->community_create_flag, $USER->ident))) { 23 if (!preg_match("/^[A-Za-z0-9]{3, 12}$/",$comm_username)) {24 $messages[] = __gettext("Error! The community username must contain letters and numbers only, cannot be blank, and must be between 3 and 12characters in length.");23 if (!preg_match("/^[A-Za-z0-9]{3,20}$/",$comm_username)) { 24 $messages[] = __gettext("Error! The community username must contain letters and numbers only, cannot be blank, and must be between 3 and 20 characters in length."); 25 25 } else if (trim($comm_name) == "") { 26 26 $messages[] = __gettext("Error! The community name cannot be blank."); 27 27 } else { -
mod/admin/lib/admin_actions.php
old new 40 40 $change_iconquota = optional_param('change_iconquota',0,PARAM_INT); 41 41 if (!empty($id)) { 42 42 if (!empty($change_username)) { 43 if (!preg_match("/^[A-Za-z0-9]{3, 12}$/",$change_username)) {44 $messages[] = __gettext("Error! The new username must contain letters and numbers only, cannot be blank, and must be between 3 and 12characters in length.");43 if (!preg_match("/^[A-Za-z0-9]{3,20}$/",$change_username)) { 44 $messages[] = __gettext("Error! The new username must contain letters and numbers only, cannot be blank, and must be between 3 and 20 characters in length."); 45 45 } else { 46 46 $u = new StdClass; 47 47 $u->username = $change_username; … … 124 124 continue; 125 125 } 126 126 127 if (!preg_match("/^[A-Za-z0-9]{3, 12}$/",$new_username[$i])) {128 $messages[] = sprintf(__gettext("New username %d (%s) was invalid; usernames must contain letters and numbers only, cannot be blank, and must be between 3 and 12characters in length.")127 if (!preg_match("/^[A-Za-z0-9]{3,20}$/",$new_username[$i])) { 128 $messages[] = sprintf(__gettext("New username %d (%s) was invalid; usernames must contain letters and numbers only, cannot be blank, and must be between 3 and 20 characters in length.") 129 129 ,($i + 1),$new_username[$i]); 130 130 continue; 131 131 } -
mod/invite/lib/invite_actions.php
old new 100 100 $messages[] = __gettext("Error! Invalid password. Your passwords must match and be between 6 and 16 characters in length."); 101 101 break; 102 102 } 103 if (!preg_match("/^[A-Za-z0-9]{3, 12}$/",$username)) {104 $messages[] = __gettext("Error! Your username must contain letters and numbers only, cannot be blank, and must be between 3 and 12characters in length.");103 if (!preg_match("/^[A-Za-z0-9]{3,20}$/",$username)) { 104 $messages[] = __gettext("Error! Your username must contain letters and numbers only, cannot be blank, and must be between 3 and 20 characters in length."); 105 105 break; 106 106 } 107 107 $username = strtolower($username);
