Changeset 27296 for extensions/LCAS
- Timestamp:
- Feb 9, 2014, 10:09:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/LCAS/trunk/main.inc.php
r27129 r27296 51 51 // Define prefilter to add tooltips on register page 52 52 add_event_handler('init', 'LCAS_InitPage'); 53 53 54 // For page password.php, modifies $POST['username_or_email'] with registered 55 // username, if this username is found in the DB with current rules of LCAS. 56 add_event_handler('loc_begin_password', 'LCAS_InitPage'); 57 54 58 function LCAS_InitPage() 55 59 { 56 global $ template, $conf, $lang;57 58 $conf_LCAS = unserialize($conf['LoginCaseAccentsSensitivity']);60 global $conf; 61 62 $conf_LCAS = unserialize($conf['LoginCaseAccentsSensitivity']); 59 63 60 64 // Set $conf['insensitive_case_logon'] to false, as LCAS takes completely 61 65 // in charge everything concerning the case and the accents in the login 62 66 if ($conf_LCAS[0] != '0') $conf['insensitive_case_logon'] = false; 63 64 /* User identification */ 65 if (script_basename() == 'identification') 66 { 67 if (isset($_POST['username']) and isset($conf_LCAS[0])) 68 { 69 $new_username = LCAS_SearchCaseUsername($_POST['username'],$conf_LCAS[0]); 70 $_POST['username'] = $new_username == '' ? $_POST['username'] : $new_username; 71 } 72 } 73 67 68 $s = script_basename(); 74 69 // Add tooltips on register page 75 if ( script_basename()== 'register') {70 if ($s == 'register') { 76 71 $template->assign(array( 77 72 'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])], … … 79 74 )); 80 75 $template->set_prefilter('register', 'LCAS_add_tooltips_prefilter_register'); 76 } 77 else if ($s == 'identification') $p = 'username'; 78 else if ($s == 'password') $p = 'username_or_email'; 79 else return false; 80 if (isset($_POST[$p]) and isset($conf_LCAS[0])) { 81 $new_username = LCAS_SearchCaseUsername($_POST[$p],$conf_LCAS[0]); 82 $_POST[$p] = $new_username == '' ? $_POST[$p] : $new_username; 81 83 } 82 84 }
Note: See TracChangeset
for help on using the changeset viewer.