Changeset 27322 for extensions/LCAS
- Timestamp:
- Feb 10, 2014, 11:20:27 PM (10 years ago)
- Location:
- extensions/LCAS/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/LCAS/trunk/include/functions.inc.php
r10549 r27322 284 284 285 285 /** 286 * Function called from main.inc.php - For test on username case sensitivity 287 * Have to be deleted before first release build 286 * Function called from main.inc.php 288 287 * 289 288 * @param : $username typed in by user for identification -
extensions/LCAS/trunk/main.inc.php
r27296 r27322 58 58 function LCAS_InitPage() 59 59 { 60 global $ conf;60 global $template, $conf, $lang; 61 61 62 62 $conf_LCAS = unserialize($conf['LoginCaseAccentsSensitivity']); … … 66 66 if ($conf_LCAS[0] != '0') $conf['insensitive_case_logon'] = false; 67 67 68 $s = script_basename(); 69 // Add tooltips on register page 70 if ($s == 'register') { 71 $template->assign(array( 72 'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])], 73 'LCAS_password_tooltip' => $lang['LCAS_tooltip_password_register'], 74 )); 75 $template->set_prefilter('register', 'LCAS_add_tooltips_prefilter_register'); 68 $p = ''; 69 70 switch (script_basename()) { 71 72 case 'register': 73 $template->assign(array( 74 'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])], 75 'LCAS_password_tooltip' => $lang['LCAS_tooltip_password_register'], 76 )); 77 $template->set_prefilter('register', 'LCAS_add_tooltips_prefilter_register'); 78 break; 79 80 case 'identification': 81 $p = 'username'; 82 $template->assign(array( 83 'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])], 84 'LCAS_password_tooltip' => $lang['LCAS_tooltip_password_register'], 85 )); 86 $template->set_prefilter('identification', 'LCAS_add_tooltips_prefilter_identification'); 87 break; 88 89 case 'password': 90 $p = 'username_or_email'; 91 $template->assign(array( 92 'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])], 93 )); 94 $template->set_prefilter('password', 'LCAS_add_tooltips_prefilter_password'); 95 break; 96 97 default: return false; 76 98 } 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])) { 99 100 if (($p != '') and isset($_POST[$p]) and isset($conf_LCAS[0])) { 81 101 $new_username = LCAS_SearchCaseUsername($_POST[$p],$conf_LCAS[0]); 82 102 $_POST[$p] = $new_username == '' ? $_POST[$p] : $new_username; … … 84 104 } 85 105 106 function LCAS_add_tooltips_prefilter_password($content, &$smarty) { 107 $search = '<label> 108 {\'Username or email\''; 109 $replacement = '<label title="{$LCAS_username_tooltip}"> 110 {\'Username or email\''; 111 $content = str_replace($search, $replacement, $content); 112 $search = 'name="username_or_email"'; 113 $replacement = 'name="username_or_email" title="{$LCAS_username_tooltip}"'; 114 $content = str_replace($search, $replacement, $content); 115 return $content; 116 } 117 86 118 function LCAS_add_tooltips_prefilter_register($content, &$smarty) { 87 119 $search = 'for="login"'; … … 102 134 $search = 'name="password_conf"'; 103 135 $replacement = 'name="password_conf" title="{$LCAS_password_tooltip}"'; 136 $content = str_replace($search, $replacement, $content); 137 return $content; 138 } 139 140 function LCAS_add_tooltips_prefilter_identification($content, &$smarty) { 141 $search = 'for="username"'; 142 $replacement = 'for="username" title="{$LCAS_username_tooltip}"'; 143 $content = str_replace($search, $replacement, $content); 144 $search = 'name="username"'; 145 $replacement = 'name="username" title="{$LCAS_username_tooltip}"'; 146 $content = str_replace($search, $replacement, $content); 147 $search = 'for="password"'; 148 $replacement = 'for="password" title="{$LCAS_password_tooltip}"'; 149 $content = str_replace($search, $replacement, $content); 150 $search = 'name="password"'; 151 $replacement = 'name="password" title="{$LCAS_password_tooltip}"'; 104 152 $content = str_replace($search, $replacement, $content); 105 153 return $content;
Note: See TracChangeset
for help on using the changeset viewer.