Changeset 8239 for extensions/LCAS/trunk/main.inc.php
- Timestamp:
- Dec 22, 2010, 11:02:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/LCAS/trunk/main.inc.php
r8206 r8239 47 47 } 48 48 49 // Check users identification 49 50 add_event_handler('init', 'LCAS_InitPage'); 50 51 … … 60 61 if (isset($_POST['username'])) 61 62 { 62 /* User non case sensitive*/63 /* Username is case insensitive only */ 63 64 if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'true' and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'false') 64 65 { … … 67 68 } 68 69 69 /* User non accent sensitive*/70 /* Username is accent insensitive only */ 70 71 if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'false' and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true') 71 72 { … … 74 75 } 75 76 76 / * User non accentsensitive */77 if (isset($conf_LCAS[ 1]) and $conf_LCAS[1] == 'true' and isset($conf_LCAS[0]) and $conf_LCAS[0] == 'true')77 //* Username is accent and case insensitive */ 78 if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'true' and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true') 78 79 { 79 80 $new_username = LCAS_SearchCaseUsername($_POST['username'],3); … … 83 84 } 84 85 } 86 87 // Check users registration 88 add_event_handler('register_user_check', 'LCAS_RegistrationCheck'); 89 90 function LCAS_RegistrationCheck($errors) 91 { 92 global $conf, $lang; 93 94 $conf_LCAS= unserialize($conf['LoginCaseAccentsSensitivity']); 95 96 load_language('plugin.lang', LCAS_PATH); 97 98 /* Username is accent and case insensitive */ 99 if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'true' and $conf['insensitive_case_logon'] == true and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true') 100 { 101 $NewPostLogin = LCAS_SearchCaseUsername($_POST['login'],3); 102 } 103 /* Username is accent insensitive only */ 104 elseif (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'false' and $conf['insensitive_case_logon'] == false and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true') 105 { 106 $NewPostLogin = LCAS_SearchCaseUsername($_POST['login'],2); 107 } 108 /* Username is case insensitive only is already controled by Piwigo with $conf['insensitive_case_logon'] == true */ 109 110 if (isset($NewPostLogin) and get_userid($NewPostLogin)) 111 { 112 $lang['reg_err_login5'] = $lang['reg_err_login5'].l10n('LCAS_accent_error'); 113 array_push($errors, $lang['reg_err_login5']); 114 } 115 116 return $errors; 117 } 85 118 ?>
Note: See TracChangeset
for help on using the changeset viewer.