Changeset 10493
- Timestamp:
- Apr 18, 2011, 9:48:41 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/LCAS/trunk/main.inc.php
r10245 r10493 4 4 Version: 0.0.0RC1 5 5 Description: Allow to disable login/register name to be sensible to the case/accents 6 Plugin URI: http://fr.piwigo.org/ forum/viewtopic.php?pid=1585637 Author: Eric, LucMorizur, Whiler8 Author URI: http://www.infernoweb.net, http://blogs.wittwer.fr/whiler /6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=513 7 Author: Eric, Whiler, LucMorizur 8 Author URI: http://www.infernoweb.net, http://blogs.wittwer.fr/whiler, http://myr.luc.free.fr 9 9 */ 10 10 … … 17 17 18 18 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 19 if (!defined('LCAS_PATH')) define('LCAS_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 19 if (!defined('LCAS_PATH')) 20 define('LCAS_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 20 21 21 22 include_once (LCAS_PATH.'include/constants.php'); … … 37 38 $name = $plugin['name']; 38 39 39 // to be removed in final version :40 global $template;41 $template->delete_compiled_templates();42 43 40 array_push($menu, 44 41 array( … … 51 48 } 52 49 53 function LCAS_add_tooltips_prefilter_register($content, &$smarty) {54 $search = 'for="login"';55 $replacement = 'for="login" title="{$LCAS_username_tooltip}"';56 $content = str_replace($search, $replacement, $content);57 $search = 'name="login"';58 $replacement = 'name="login" title="{$LCAS_username_tooltip}"';59 $content = str_replace($search, $replacement, $content);60 $search = 'for="password"';61 $replacement = 'for="password" title="{$LCAS_password_tooltip}"';62 $content = str_replace($search, $replacement, $content);63 $search = 'name="password"';64 $replacement = 'name="password" title="{$LCAS_password_tooltip}"';65 $content = str_replace($search, $replacement, $content);66 $search = 'for="password_conf"';67 $replacement = 'for="password_conf" title="{$LCAS_password_tooltip}"';68 $content = str_replace($search, $replacement, $content);69 $search = 'name="password_conf"';70 $replacement = 'name="password_conf" title="{$LCAS_password_tooltip}"';71 $content = str_replace($search, $replacement, $content);72 return $content;73 }74 75 50 // Check users identification 51 // Define prefilter to add tooltips on register page 76 52 add_event_handler('init', 'LCAS_InitPage'); 77 53 … … 83 59 84 60 // Set $conf['insensitive_case_logon'] to false, as LCAS takes completely 85 // in charge everything around the case and the accents 86 if ($conf_LCAS[0] != '0') 87 $conf['insensitive_case_logon'] = false; 61 // in charge everything concerning the case and the accents in the login 62 if ($conf_LCAS[0] != '0') $conf['insensitive_case_logon'] = false; 88 63 89 /* User identification */64 /* User identification */ 90 65 if (script_basename() == 'identification') 91 66 { … … 107 82 } 108 83 84 function LCAS_add_tooltips_prefilter_register($content, &$smarty) { 85 $search = 'for="login"'; 86 $replacement = 'for="login" title="{$LCAS_username_tooltip}"'; 87 $content = str_replace($search, $replacement, $content); 88 $search = 'name="login"'; 89 $replacement = 'name="login" title="{$LCAS_username_tooltip}"'; 90 $content = str_replace($search, $replacement, $content); 91 $search = 'for="password"'; 92 $replacement = 'for="password" title="{$LCAS_password_tooltip}"'; 93 $content = str_replace($search, $replacement, $content); 94 $search = 'name="password"'; 95 $replacement = 'name="password" title="{$LCAS_password_tooltip}"'; 96 $content = str_replace($search, $replacement, $content); 97 $search = 'for="password_conf"'; 98 $replacement = 'for="password_conf" title="{$LCAS_password_tooltip}"'; 99 $content = str_replace($search, $replacement, $content); 100 $search = 'name="password_conf"'; 101 $replacement = 'name="password_conf" title="{$LCAS_password_tooltip}"'; 102 $content = str_replace($search, $replacement, $content); 103 return $content; 104 } 105 109 106 // Check users registration 110 107 // Returns error … … 145 142 146 143 $template->assign(array( 147 'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_index'][intval($conf_LCAS[0])], 148 'LCAS_password_tooltip' => $lang['LCAS_tooltip_password_index'], 144 'LCAS_username_tooltip' => 145 $lang['LCAS_tooltip_username_index'][intval($conf_LCAS[0])], 146 'LCAS_password_tooltip' => 147 $lang['LCAS_tooltip_password_index'], 149 148 )); 150 149 $template->set_prefilter('menubar', 'LCAS_add_tooltips_prefilter_index');
Note: See TracChangeset
for help on using the changeset viewer.