Index: extensions/NBC_UserAdvManager/trunk/changelog.txt.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/changelog.txt.php	(revision 4384)
+++ extensions/NBC_UserAdvManager/trunk/changelog.txt.php	(revision 4384)
@@ -0,0 +1,114 @@
+<?php
+/*
+Plugin Name: NBC_UserAdvManager
+** Change log **
+***** Plugin history (branch 2.10)*****
+
+-- 2.10.0-beta : Initial beta release for Piwigo compatibility
+-- 2.10.1-beta : Small correction on generated path
+-- 2.10.2-beta : Bug resolved on register validation page
+
+-- 2.10.3 : Final and fully functional release
+						Bug resolved on plugin activation
+
+-- 2.10.4 : Bug fixed on profiles update
+
+-- 2.10.5 : Improved code on profiles update
+
+-- 2.10.6 : Old language packs (iso) deleted (forget from PWG 1.7.x version)
+
+-- 2.10.7 : Bug fixed on user's validation email sending
+
+-- 2.10.8 : ConfirmMail page looks better (Sylvia theme only)
+						Improved code for checking author on guest comments
+
+-- 2.10.9 : Bug fixed - Missing english translation
+						Bug fixed - Notice on forbidden characters function use
+						Bug fixed - Audit on forbidden characters in username didn't work
+						Adding of email provider exclusion (like *@hotmail.com) - Warning ! -> Known bug : This feature doesn't work on user profile page. So, already registered users can change their email address to a forbiden one.
+
+-- 2.10.9a : Email provider exclusion is no longer case sensitive
+
+-- 2.10.9b : Bug fixed - Home icon wasn't linked to gallery url in ConfirmMail page. If GALLERY_URL is not set, Home icon gets the pwg root path.
+
+-- 2.10.9c : Bug fixed - If Email provider exclusion is set off, new registered user will have a PHP notice on "Undefined variable: ncsemail"
+
+-- 2.10.9d : Code simplification - need no more ""template"" sub-directory in plugin directory for enhance "back link" icon in ConfirMail.tpl
+
+-- 2.10.9e : Compatibility improvement with PHP 5.3 - Some old functions will be deprecated like :
+							ereg replaced by preg_match
+							eregi replace by preg_match with "i" moderator
+							split replace by preg_split
+				
+-- 2.10.9f : Compatibility bug fixed when used with DynamicRecentPeriod plugin
+
+
+***** Plugin history (branch 2.11)***** 
+
+-- 2.11.0 : New tabsheet menu to manage ConfirMail functions (setting a timeout without validation, Cleanup expired user's accounts, Force confirmation, Renew validation key, list unvalidated users,...)
+						Beautify plugin's main admin panel
+						
+-- 2.11.1 : Bug fixed with install and upgrade functions
+						Language files correction
+
+-- 2.11.2 : Bug fixed on bad query for unvalidated users display in unvalidated users list
+						Bug fixed : Sql syntax error on plugin activation
+
+-- 2.11.3 : On Patricia's request (french forum and bug 1173), the unvalidated users management tab shows users according with the settings of unvalidated group and / or unvalidated status.
+						Feature 1172 added : Email providers exclusion list can be set with CR/LF between each entry. The comma seperator (,) is still mandatory.
+						Bug 1175 fixed : Bad translation tag in french language file.
+						Improvement of unvalidated users management tab (feature 1174)- Expired users are displayed in red color text.
+
+-- 2.11.4 : Bug 1177 fixed : Width of excluded email providers list reset to ancient value (80 col)
+						Bug 1179 fixed : Adding a notice in plugin inline documentation for use of validation groups and status. A default group must be set in Piwigo's groups settings and the "Guest" (or another user) must be set as default for status values.
+						Bug 1182 fixed : Language tag missing in confirmation email generation 
+
+-- 2.11.5 : Bug 1195 fixed : Registration displays the good title
+
+
+***** Plugin history (branch 2.12)*****
+
+-- 2.12.0 : Bug 1206 fixed : All plugin functionnalities work in user's profile page
+            Plugin's core code and admin panel refactoring
+            Password control and enforcement : A complexity score is computed on user registration. If this score is less than the goal set by admin, the password choosen is rejected.
+            Feature 1194 "Ghost Tracker" added : New plugin tab displays users who don't comes back to the gallery since x days. Ability to send email reminders and to delete reminded but "dead" users. It's the reason why this feature is called "Ghost Tracker".
+
+-- 2.12.1 : Rollback on admin panel improvement (it was a bad idea)
+
+-- 2.12.2 : Bug 1221 fixed - Adding of a new funtion to populate the lastvisit table on Ghost Tracker activation
+            Bug 1224 fixed - Error in database after plugin activation
+            Bug 1225 fixed - "Reminder" status don't change from "false" to "true" after the sent of a reminder email
+            Some code beautify (SQL requests and HTML 4 strict for tpl)
+
+-- 2.12.3 : Bug 1226 fixed - "duplicate key error" when lastvisit table is not empty and on using Ghost Tracker init function
+
+-- 2.12.4 : Adding a password field control for SendMail2User - Neighborhood plugin compatibility improvement 
+            Bug 1229 fixed - Email was no longer mandatory when plugin was active, even if Piwigo's email madatory option was set. 
+
+-- 2.12.5 : Bug 1233 fixed -  "duplicate key error" when a user wants to register with an existing username. In fact, all standard Piwigo's register controls didn't work when plugin was activated. That fixes this too.
+            Adding DE, ES and IT languages. All translations are not finalized and could be improved.
+            Adding of description.txt file in language directories.
+
+-- 2.12.6 : Bug 1236 fixed -  Admins was unable to add a new user in the user_list page.
+            Beginning of IT translations
+            
+-- 2.12.7 : Bug 1238 fixed - Simple custom email text wasn't send when Extended Description plugin wasn't set
+            Bug 1245 fixed - Semicolons (;) are no longer allowed in text areas (mail info text, ConfirmMail text, reminder text,...). They'll be replaced by dots (.).
+            Bug 1248 fixed - Php notice on user registration with a forbidden email domain
+            Bug 1250 fixed - Email provider didn't work after the third exclusion in list
+            Escaping all special characters typed in login name and recover them
+
+
+***** Plugin history (branch 2.13)*****
+ 
+-- 2.13.0 : Bug 1246
+            Evolution 1239 - New option to add a new tab that shows the number of days since their last visit for each registered user.
+            Bug 1257 fixed - If email exclusion list begins with a CR-LF, an informative warning message is displayed (I was unable to delete automatically this CR-LF).
+            Bug 1259 fixed - PHP notice on user addition by admin in user_list page.
+            Bug 1260 fixed - Username case sensitivity is now fully functionnal in all users entries (user registration and admin panel)
+            Evolution 1273 - Adding of reminder field in advanced user management tab. This allows to see if a reminder have already been send.
+            Evolution 1292 - Adding of navigation bar in tabs where users are listed (when more than 1 page is needed to display users).
+            Code refactory and improvements.
+            Translations improvements.
+*/
+?>
Index: extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php	(revision 4383)
+++ extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php	(revision 4384)
@@ -625,13 +625,18 @@
   if (isset($username))
   {
-    $usercase = strtolower($username);
     $query = "
 SELECT ".$conf['user_fields']['username']."
-  FROM ".USERS_TABLE."
-WHERE LOWER(".stripcslashes($conf['user_fields']['username']).") = '".$usercase."'
-;";
-    list($usercase) = mysql_fetch_row(pwg_query($query));
-
-    return isset($username) ? stripslashes($usercase) : '';
+FROM ".USERS_TABLE."
+WHERE LOWER(".stripslashes($conf['user_fields']['username']).") = '".strtolower($username)."'
+;";
+    $users = mysql_num_rows(pwg_query($query));
+    if ($users > 0)
+    {
+      return true;
+    }
+    else
+    {
+      return false;
+    }
   }
 }
@@ -647,13 +652,17 @@
   if (isset($login) and isset($conf_nbc_UserAdvManager[8]) and $conf_nbc_UserAdvManager[8] <> '')
   {
-  	$pattern = '/'.$conf_nbc_UserAdvManager[8].'/';
-    if ( preg_match($pattern, $login) )
-      return false;
-    else
-      return true;
+    $conf_nbc_CharExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[8]);
+    for ($i = 0 ; $i < count($conf_nbc_CharExclusion) ; $i++)
+    {
+      $pattern = '/'.$conf_nbc_CharExclusion[$i].'/i';
+      if (preg_match($pattern, $login))
+      {
+        return true;
+      }
+    }
   }
   else
   {
-    return true;
+    return false;
   }
 }
@@ -667,21 +676,22 @@
 
 	$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
-	if (isset($conf_nbc_UserAdvManager[12]))
+  
+	if (isset($email) and isset($conf_nbc_UserAdvManager[13]) and $conf_nbc_UserAdvManager[13] <> '')
 	{
-		$ncsemail = strtolower($email);
+		//$ncsemail = strtolower($email);
 		$conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
 		for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
 		{
-			$pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
-			if (preg_match($pattern, $ncsemail))
+			$pattern = '/'.$conf_nbc_MailExclusion[$i].'/i';
+			if (preg_match($pattern, $email))
       {
-        		return false;
-      }
-      else
-      {
-      			return true;
+        		return true;
       }
 		}
 	}
+  else
+  {
+    return false;
+  }
 }
 
Index: extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 4383)
+++ extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 4384)
@@ -60,10 +60,12 @@
 $lang['UserAdvManager_No_Casse_true'] = ' Make the user account case insensitive at the registration and the identification step (USER = user = User = usER...).';
 // --------- End: New or revised $lang ---- from version 2.12.6
+// --------- Starting below: New or revised $lang ---- from version 2.13.0
+$lang['UserAdvManager_Add_LastVisit_Column'] = ' View user monitoring record (date of last visit, time spent (in days) since their last visit ,...). Monitoring is purely informative for the administrator of the gallery.';
+$lang['UserAdvManager_Add_LastVisit_Column_true'] = ' Enable user monitoring list.';
+$lang['UserAdvManager_Add_LastVisit_Column_false'] = ' Disable user monitoring list (Default).';
+// --------- End: New or revised $lang ---- from version 2.13.0
 
 
 /* ConfirmMail Configuration Tab */
-$lang['ConfirmMail_Title'] = 'Advanced management and settings of register confirmation by mail';
-$lang['Title_Tab2'] = 'UserAdvManager - ConfirmMail Settings';
-$lang['Tab_ConfirmMail'] = 'ConfirmMail Settings';
 $lang['UserAdvManager_ConfirmMail_Info'] = 'Time limitation for validation of registration :<br>If you enable this option, select the desired time (x) in the field below. Visitors who register will then have x days to validate their registration. After this period the validation link they have received by mail will be expired.<br>';
 $lang['UserAdvManager_ConfirmMail_TimeOut_true'] = 'Enable limiting the registration deadline.';
@@ -76,10 +78,36 @@
 $lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Custom content of the reminder message with regeneration of validation key.<br>If left blank, the reminder email will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled at the plugin installation is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
 $lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Custom content of the reminder message without regeneration of validation key.<br>If left blank, the reminder email will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled at the plugin installation is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
+// --------- Starting below: New or revised $lang ---- from version 2.13.0
+$lang['ConfirmMail_Title'] = 'Advanced settings for validation of registries';
+$lang['Title_Tab2'] = 'UserAdvManager - Register validation settings';
+$lang['Tab_ConfirmMail'] = 'Register validation settings';
+// --------- End: New or revised $lang ---- from version 2.13.0
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.13.0
+/* UserList Tab */
+$lang['Title_Tab5'] = 'UserAdvManager - User Information';
+$lang['UserList_Title'] = 'Monitoring registered users';
+$lang['Tab_UserList'] = 'Monitoring users';
+$lang['UserAdvManager_User_List'] = 'This page is for information to the administrator. It displays a list of all users registered on the gallery showing the date and number of days since their last visit. The list is sorted in ascending order of number of days.
+<br><br>
+When the Ghost Tracker is active, the number of days without a visit appears as the following color code, according to the maximum set in the Ghost Tracker options:
+<br>
+- <b style="color: lime;">Green</b> : When the user has visited the gallery <b style="color: lime;"><u>less than 50%</u></b> of the maximum indicated in the Ghost Tracker.<br>
+- <b style="color: orange;">Orange</b> : When the user has visited the gallery <b style="color: orange;"><u> between 50% and 99% </u></b> of the maximum indicated in the Ghost Tracker.<br>
+- <b style="color: red;">Red</b> : When the user has visited the gallery <b style="color: red;"><u>for more than 99%</u></b> of the maximum indicated in the Ghost Tracker. <b><u>In this case, the user must also appear in the Ghost Tracker table.</u></b><br>
+<br>
+Example :
+<br>
+The maximum period of Ghost Tracker is configured to 100 days.
+<br>
+A user will appear in green if he visited the gallery for less than 50 days, in orange if his last visit took place between 50 and 99 days and red for 100 days and above.
+<br><br>
+<b>NOTE</b> : The list does not display who have not validated their registration (if the option of validating the registration is activated). These users are then managed in a special way in the "Validation management.';
+$lang['Nb_Days'] = 'Number of days<br>since last visit';
+// --------- End: New or revised $lang ---- from version 2.13.0
 
 
 /* UserManager Tab */
-$lang['UserManager_Title'] = 'Advanced settings of unvalidated registered users';
-$lang['Title_Tab3'] = 'UserAdvManager - Visitors management';
-$lang['Tab_UserManager'] = 'Visitors management';
 $lang['UserAdvManager_ConfirmMail_User_List'] = 'When limiting the deadline for registration is enabled, you will find below the list of users awaiting validation, <b style="text-decoration: underline;">whether or not</b> they are in time to validate.<br><br>In this view, you can:
 <br><br>
@@ -93,4 +121,9 @@
 <br>';
 $lang['Registration_Date'] = 'Registration date';
+// --------- Starting below: New or revised $lang ---- from version 2.13.0
+$lang['UserManager_Title'] = 'Advanced management of unvalidated';
+$lang['Title_Tab3'] = 'UserAdvManager - Management of registration validations';
+$lang['Tab_UserManager'] = 'Management validations';
+// --------- End: New or revised $lang ---- from version 2.13.0
 
 
@@ -114,4 +147,7 @@
 <br>';
 // --------- End: New or revised $lang ---- from version 2.12.2
+// --------- Starting below: New or revised $lang ---- from version 2.13.0
+$lang['Reminder'] = 'Email Reminder';
+// --------- End: New or revised $lang ---- from version 2.13.0
 
 
@@ -179,4 +215,7 @@
 $lang['mail_exclusionlist_error'] = 'Warning! You have entered a new line (CR-LF) at the begining of email exclusion list (shown in red below). Although this new line is not visible, it is still present and may cause malfunction of the plugin. Please re-type in your exclusion list in a manner that does not begin with a newline.';
 // --------- End: New or revised $lang ---- from version 2.12.8
+// --------- Starting below: New or revised $lang ---- from version 2.13.0
+$lang['Err_Userlist_Settings'] = 'Cette page n\'est accessible que si le "suivi des utilisateur" est actif dans l\'onglet "Configuration Générale".';
+// --------- End: New or revised $lang ---- from version 2.13.0
 
 
Index: extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 4383)
+++ extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 4384)
@@ -104,5 +104,5 @@
 Un utilisateur apparaitra en vert s\'il a visité la galerie depuis moins de 50 jours, en orange si sa dernière visite s\'est déroulée entre 50 et 99 jours et en rouge à 100 jours et au-delà.
 <br><br>
-<b>A NOTER</b> : La liste n\'affiche pas les inscrits qui n\'auraient pas validé leur inscription (si l\'option de validation de l\'inscription est activée). Ces utilisateurs sont alors gérés de manière particulière dans l\'onglet "Gestion des visiteurs".';
+<b>A NOTER</b> : La liste n\'affiche pas les inscrits qui n\'auraient pas validé leur inscription (si l\'option de validation de l\'inscription est activée). Ces utilisateurs sont alors gérés de manière particulière dans l\'onglet "Gestion des validations".';
 $lang['Nb_Days'] = 'Nb de jours<br>depuis dernière visite';
 // --------- End: New or revised $lang ---- from version 2.13.0
@@ -161,4 +161,5 @@
 $lang['Reminder_with_key_of_%s'] = '%s, votre clé de confirmation a été renouvelée';
 $lang['Reminder_without_key_of_%s'] = '%s, votre clé de confirmation va expirer';
+$lang['Ghost_remainder_of_%s'] = '%s, ceci est un email de rappel.';
 
 
Index: extensions/NBC_UserAdvManager/trunk/main.inc.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 4383)
+++ extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 4384)
@@ -9,116 +9,7 @@
 */
 
+/* History:  NBC_UserAdvManager_PATH.'Changelog.txt.php' */
+
 /*
- ***** Plugin history (branch 2.10)*****
-
--- 2.10.0-beta : Initial beta release for Piwigo compatibility
--- 2.10.1-beta : Small correction on generated path
--- 2.10.2-beta : Bug resolved on register validation page
-
--- 2.10.3 : Final and fully functional release
-						Bug resolved on plugin activation
-
--- 2.10.4 : Bug fixed on profiles update
-
--- 2.10.5 : Improved code on profiles update
-
--- 2.10.6 : Old language packs (iso) deleted (forget from PWG 1.7.x version)
-
--- 2.10.7 : Bug fixed on user's validation email sending
-
--- 2.10.8 : ConfirmMail page looks better (Sylvia theme only)
-						Improved code for checking author on guest comments
-
--- 2.10.9 : Bug fixed - Missing english translation
-						Bug fixed - Notice on forbidden characters function use
-						Bug fixed - Audit on forbidden characters in username didn't work
-						Adding of email provider exclusion (like *@hotmail.com) - Warning ! -> Known bug : This feature doesn't work on user profile page. So, already registered users can change their email address to a forbiden one.
-
--- 2.10.9a : Email provider exclusion is no longer case sensitive
-
--- 2.10.9b : Bug fixed - Home icon wasn't linked to gallery url in ConfirmMail page. If GALLERY_URL is not set, Home icon gets the pwg root path.
-
--- 2.10.9c : Bug fixed - If Email provider exclusion is set off, new registered user will have a PHP notice on "Undefined variable: ncsemail"
-
--- 2.10.9d : Code simplification - need no more ""template"" sub-directory in plugin directory for enhance "back link" icon in ConfirMail.tpl
-
--- 2.10.9e : Compatibility improvement with PHP 5.3 - Some old functions will be deprecated like :
-							ereg replaced by preg_match
-							eregi replace by preg_match with "i" moderator
-							split replace by preg_split
-				
--- 2.10.9f : Compatibility bug fixed when used with DynamicRecentPeriod plugin
-
-
- ***** Plugin history (branch 2.11)***** 
-
--- 2.11.0 : New tabsheet menu to manage ConfirMail functions (setting a timeout without validation, Cleanup expired user's accounts, Force confirmation, Renew validation key, list unvalidated users,...)
-						Beautify plugin's main admin panel
-						
--- 2.11.1 : Bug fixed with install and upgrade functions
-						Language files correction
-
--- 2.11.2 : Bug fixed on bad query for unvalidated users display in unvalidated users list
-						Bug fixed : Sql syntax error on plugin activation
-
--- 2.11.3 : On Patricia's request (french forum and bug 1173), the unvalidated users management tab shows users according with the settings of unvalidated group and / or unvalidated status.
-						Feature 1172 added : Email providers exclusion list can be set with CR/LF between each entry. The comma seperator (,) is still mandatory.
-						Bug 1175 fixed : Bad translation tag in french language file.
-						Improvement of unvalidated users management tab (feature 1174)- Expired users are displayed in red color text.
-
--- 2.11.4 : Bug 1177 fixed : Width of excluded email providers list reset to ancient value (80 col)
-						Bug 1179 fixed : Adding a notice in plugin inline documentation for use of validation groups and status. A default group must be set in Piwigo's groups settings and the "Guest" (or another user) must be set as default for status values.
-						Bug 1182 fixed : Language tag missing in confirmation email generation 
-
--- 2.11.5 : Bug 1195 fixed : Registration displays the good title
-
-
- ***** Plugin history (branch 2.12)*****
-
--- 2.12.0 : Bug 1206 fixed : All plugin functionnalities work in user's profile page
-            Plugin's core code and admin panel refactoring
-            Password control and enforcement : A complexity score is computed on user registration. If this score is less than the goal set by admin, the password choosen is rejected.
-            Feature 1194 "Ghost Tracker" added : New plugin tab displays users who don't comes back to the gallery since x days. Ability to send email reminders and to delete reminded but "dead" users. It's the reason why this feature is called "Ghost Tracker".
-
--- 2.12.1 : Rollback on admin panel improvement (it was a bad idea)
-
--- 2.12.2 : Bug 1221 fixed - Adding of a new funtion to populate the lastvisit table on Ghost Tracker activation
-            Bug 1224 fixed - Error in database after plugin activation
-            Bug 1225 fixed - "Reminder" status don't change from "false" to "true" after the sent of a reminder email
-            Some code beautify (SQL requests and HTML 4 strict for tpl)
-
--- 2.12.3 : Bug 1226 fixed - "duplicate key error" when lastvisit table is not empty and on using Ghost Tracker init function
-
--- 2.12.4 : Adding a password field control for SendMail2User - Neighborhood plugin compatibility improvement 
-            Bug 1229 fixed - Email was no longer mandatory when plugin was active, even if Piwigo's email madatory option was set. 
-
--- 2.12.5 : Bug 1233 fixed -  "duplicate key error" when a user wants to register with an existing username. In fact, all standard Piwigo's register controls didn't work when plugin was activated. That fixes this too.
-            Adding DE, ES and IT languages. All translations are not finalized and could be improved.
-            Adding of description.txt file in language directories.
-
--- 2.12.6 : Bug 1236 fixed -  Admins was unable to add a new user in the user_list page.
-            Beginning of IT translations
-            
--- 2.12.7 : Bug 1238 fixed - Simple custom email text wasn't send when Extended Description plugin wasn't set
-            Bug 1245 fixed - Semicolons (;) are no longer allowed in text areas (mail info text, ConfirmMail text, reminder text,...). They'll be replaced by dots (.).
-            Bug 1248 fixed - Php notice on user registration with a forbidden email domain
-            Bug 1250 fixed - Email provider didn't work after the third exclusion in list
-            Escaping all special characters typed in login name and recover them
-
-
- ***** Plugin history (branch 2.13)*****
- 
--- 2.13.0 : Bug 1246
-            Evolution 1239 - New option to add a new tab that shows the number of days since their last visit for each registered user.
-            Bug 1257 fixed - If email exclusion list begins with a CR-LF, an informative warning message is displayed (I was unable to delete automatically this CR-LF).
-            Bug 1259 fixed - PHP notice on user addition by admin in user_list page.
-            Bug 1260
-            Evolution 1273 - Adding of reminder field in advanced user management tab. This allows to see if a reminder have already been send.
-            Evolution 1292 - Adding of navigation bar in tabs where users are listed (when more than 1 page is needed to display users).
-            Some code and translations refactory.
-*/
-
-/*
-
  ***** TODO List *****
 ++ Adding ASC and DESC ordering for user's lists tables (Ghost Tracker, UserList and Unvalidated) 
@@ -144,5 +35,4 @@
   ++ new copied user will (or not) get the same language
   ... and so on
-  
 */
 
@@ -323,12 +213,11 @@
 
   /* Username non case sensitive */
-  if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true')
-  {
-    $new_username =  NotSensibleSearchUsername($_POST['login']);
-    $_POST['login'] = $new_username == '' ? $_POST['login'] : $new_username;
+  if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' and NotSensibleSearchUsername($_POST['login']))
+  {
+    return($lang['reg_err_login5'] = l10n('reg_err_login5'));
   }
 
   /* Username without forbidden keys */
-  if (isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' and !empty($_POST['login']) and !ValidateUsername($_POST['login']))
+  if (isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' and !empty($_POST['login']) and ValidateUsername($_POST['login']))
   {
     $_POST['login'] = '';
@@ -337,25 +226,9 @@
 
   /* Email without forbidden domains */
-  /* This doesn't work */
-//  if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address']))
-//  {
-//    $_POST['mail_address'] = '';
-//    return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
-//  }
-  /* This work with a code copy of ValidateEmailProvider() function */
-  if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
-  {
-    $ncsemail = strtolower($_POST['mail_address']);
-    $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
-    for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
-    {
-      $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
-      if (preg_match($pattern, $ncsemail))
-      {
-        $_POST['mail_address'] = '';    			 
-        return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
-      }
-    }
-	}  
+  if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']))
+  {
+    $_POST['mail_address'] = '';
+    return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+  }
 }
 
@@ -374,28 +247,12 @@
     {
       /* Email without forbidden domains */
-      /* This doesn't work */
-//      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
-//      {
-//        if (!ValidateEmailProvider($_POST['mail_address']))
-//        {
-//          $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
-//          unset($_POST['validate']);
-//        }
-//      }
-        /* This work with a code copy of ValidateEmailProvider() function */
-        if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+      {
+        if (ValidateEmailProvider($_POST['mail_address']))
         {
-          $ncsemail = strtolower($_POST['mail_address']);
-          $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
-          for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
-          {
-            $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
-            if (preg_match($pattern, $ncsemail))
-            {    			 
-              $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
-              unset($_POST['validate']);
-            }
-          }
+          $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+          unset($_POST['validate']);
         }
+      }
 
       $typemail = 3;
@@ -459,5 +316,5 @@
 
 add_event_handler('init', 'UserAdvManager_InitPage');
- 
+/* *** Important ! This is necessary to make email exclusion work in admin's users management panel *** */
 function UserAdvManager_InitPage()
 {
@@ -466,27 +323,4 @@
 
   $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
-  
-  /* Username non case sensitive */
-  if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true')
-  {
-    $lang['reg_err_login5'] = l10n('reg_err_login5');
-  }
-  
-
- 
-/* User identification */
-  if (script_basename() == 'identification')
-  {
-    if (isset($_POST['login']))
-    {
-      /* User non case sensitive */
-      if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' )
-      {
-        $new_username =  NotSensibleSearchUsername($_POST['username']);
-        $_POST['username'] = $new_username == '' ? $_POST['username'] : $new_username;
-      }
-    }
-  }
-
 
 /* Admin user management */
@@ -495,39 +329,9 @@
     if (isset($_POST['submit_add']))
     {
-      /* User non case sensitive */
-      if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' )
-      {
-        $new_username =  NotSensibleSearchUsername($_POST['login']);
-        $_POST['login'] = $new_username == '' ? $_POST['login'] : $new_username;
-      }
-
-      /* Username without forbidden keys */
-      if (isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' and !empty($_POST['login']) and !ValidateUsername($_POST['login']))
-      {
-        $template->append('errors', l10n('reg_err_login6')."'".$conf_nbc_UserAdvManager[8]."'");
+      /* Email without forbidden domains */
+      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))
+      {
+        $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
         unset($_POST['submit_add']);
-      }
-
-      /* Email without forbidden domains */
-      /* This doesn't work */
-//      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email']))
-//      {
-//        $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
-//        unset($_POST['submit_add']);
-//      }
-      /* This work with a code copy of ValidateEmailProvider() function */
-      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']))
-      {
-        $ncsemail = strtolower($_POST['email']);
-        $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
-        for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
-        {
-          $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
-          if (preg_match($pattern, $ncsemail))
-          {    			 
-            $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
-            unset($_POST['submit_add']);
-          }
-        }
       }
     }
