Changeset 28237 for extensions/LCAS
- Timestamp:
- Apr 20, 2014, 11:04:39 AM (11 years ago)
- Location:
- extensions/LCAS
- Files:
-
- 78 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/LCAS/branch/2.3/CHANGELOG.txt
r27186 r28237 1 2014-04-20 2.3.1 2 Added LCAS functionnality on 'password' page (displayed when 3 user has forgotten his/her password). Added tooltips where 4 needed (bug:3044; svn:27296, svn:27322). 5 1 6 2014-02-04 2.3.0 2 7 Compatibility (correct, this time :-/ ) with version 2.6 of -
extensions/LCAS/branch/2.3/include/functions.inc.php
r27127 r28237 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/branch/2.3/main.inc.php
r27129 r28237 2 2 /* 3 3 Plugin Name: LCAS 4 Version: 2.3. 04 Version: 2.3.1 5 5 Description: Allow to disable login/register name to be sensible to the case/accents 6 6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=513 … … 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 60 global $template, $conf, $lang; 57 61 58 $conf_LCAS = unserialize($conf['LoginCaseAccentsSensitivity']);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 } 67 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; 72 98 } 73 74 // Add tooltips on register page 75 if (script_basename() == 'register') { 76 $template->assign(array( 77 'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])], 78 'LCAS_password_tooltip' => $lang['LCAS_tooltip_password_register'], 79 )); 80 $template->set_prefilter('register', 'LCAS_add_tooltips_prefilter_register'); 99 100 if (($p != '') and isset($_POST[$p]) and isset($conf_LCAS[0])) { 101 $new_username = LCAS_SearchCaseUsername($_POST[$p],$conf_LCAS[0]); 102 $_POST[$p] = $new_username == '' ? $_POST[$p] : $new_username; 81 103 } 104 } 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; 82 116 } 83 117 … … 100 134 $search = 'name="password_conf"'; 101 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}"'; 102 152 $content = str_replace($search, $replacement, $content); 103 153 return $content; -
extensions/LCAS/trunk/CHANGELOG.txt
r27186 r28237 1 2014-04-20 2.3.1 2 Added LCAS functionnality on 'password' page (displayed when 3 user has forgotten his/her password). Added tooltips where 4 needed (bug:3044; svn:27296, svn:27322). 5 1 6 2014-02-04 2.3.0 2 7 Compatibility (correct, this time :-/ ) with version 2.6 of -
extensions/LCAS/trunk/main.inc.php
r27322 r28237 2 2 /* 3 3 Plugin Name: LCAS 4 Version: 2.3. 04 Version: 2.3.1 5 5 Description: Allow to disable login/register name to be sensible to the case/accents 6 6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=513
Note: See TracChangeset
for help on using the changeset viewer.