Index: /extensions/LCAS/trunk/include/functions.inc.php
===================================================================
--- /extensions/LCAS/trunk/include/functions.inc.php	(revision 27321)
+++ /extensions/LCAS/trunk/include/functions.inc.php	(revision 27322)
@@ -284,6 +284,5 @@
 
 /**
- * Function called from main.inc.php - For test on username case sensitivity
- * Have to be deleted before first release build
+ * Function called from main.inc.php
  * 
  * @param : $username typed in by user for identification
Index: /extensions/LCAS/trunk/main.inc.php
===================================================================
--- /extensions/LCAS/trunk/main.inc.php	(revision 27321)
+++ /extensions/LCAS/trunk/main.inc.php	(revision 27322)
@@ -58,5 +58,5 @@
 function LCAS_InitPage()
 {
-  global $conf;
+  global $template, $conf, $lang;
 
   $conf_LCAS = unserialize($conf['LoginCaseAccentsSensitivity']);
@@ -66,17 +66,37 @@
   if ($conf_LCAS[0] != '0') $conf['insensitive_case_logon'] = false;
 
-  $s = script_basename();
-  // Add tooltips on register page
-  if ($s == 'register') {
-    $template->assign(array(
-      'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])],
-      'LCAS_password_tooltip' => $lang['LCAS_tooltip_password_register'],
-    ));
-    $template->set_prefilter('register', 'LCAS_add_tooltips_prefilter_register');
+  $p = '';
+
+  switch (script_basename()) {
+
+    case 'register':
+      $template->assign(array(
+        'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])],
+        'LCAS_password_tooltip' => $lang['LCAS_tooltip_password_register'],
+      ));
+      $template->set_prefilter('register', 'LCAS_add_tooltips_prefilter_register');
+    break;
+
+    case 'identification':
+      $p = 'username';
+      $template->assign(array(
+        'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])],
+        'LCAS_password_tooltip' => $lang['LCAS_tooltip_password_register'],
+      ));
+      $template->set_prefilter('identification', 'LCAS_add_tooltips_prefilter_identification');
+    break;
+
+    case 'password':
+      $p = 'username_or_email';
+      $template->assign(array(
+        'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])],
+      ));
+      $template->set_prefilter('password', 'LCAS_add_tooltips_prefilter_password');
+    break;
+
+    default: return false;
   }
-  else if ($s == 'identification') $p = 'username';
-  else if ($s == 'password') $p = 'username_or_email';
-  else return false;
-  if (isset($_POST[$p]) and isset($conf_LCAS[0])) {
+
+  if (($p != '') and isset($_POST[$p]) and isset($conf_LCAS[0])) {
     $new_username = LCAS_SearchCaseUsername($_POST[$p],$conf_LCAS[0]);
     $_POST[$p] = $new_username == '' ? $_POST[$p] : $new_username;
@@ -84,4 +104,16 @@
 }
 
+function LCAS_add_tooltips_prefilter_password($content, &$smarty) {
+  $search = '<label>
+      {\'Username or email\'';
+  $replacement = '<label title="{$LCAS_username_tooltip}">
+      {\'Username or email\'';
+  $content = str_replace($search, $replacement, $content);
+  $search = 'name="username_or_email"';
+  $replacement = 'name="username_or_email" title="{$LCAS_username_tooltip}"';
+  $content = str_replace($search, $replacement, $content);
+  return $content;
+}
+
 function LCAS_add_tooltips_prefilter_register($content, &$smarty) {
   $search = 'for="login"';
@@ -102,4 +134,20 @@
   $search = 'name="password_conf"';
   $replacement = 'name="password_conf" title="{$LCAS_password_tooltip}"';
+  $content = str_replace($search, $replacement, $content);
+  return $content;
+}
+
+function LCAS_add_tooltips_prefilter_identification($content, &$smarty) {
+  $search = 'for="username"';
+  $replacement = 'for="username" title="{$LCAS_username_tooltip}"';
+  $content = str_replace($search, $replacement, $content);
+  $search = 'name="username"';
+  $replacement = 'name="username" title="{$LCAS_username_tooltip}"';
+  $content = str_replace($search, $replacement, $content);
+  $search = 'for="password"';
+  $replacement = 'for="password" title="{$LCAS_password_tooltip}"';
+  $content = str_replace($search, $replacement, $content);
+  $search = 'name="password"';
+  $replacement = 'name="password" title="{$LCAS_password_tooltip}"';
   $content = str_replace($search, $replacement, $content);
   return $content;
