Index: /extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 4339)
+++ /extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 4340)
@@ -53,4 +53,5 @@
 $UserAdvManager_ConfirmMail_Error_Txt1 = false;
 $UserAdvManager_ConfirmMail_Error_Txt2 = false;
+$UserAdvManager_Exclusionlist_Error = false;
 
 // +-----------------------------------------------------------------------+
@@ -98,4 +99,11 @@
       
       array_push($page['errors'], l10n('mail_text_error'));
+    }
+
+    /* Check if CR-LF exist at begining and end of mail exclusion list - If yes, removes them */
+    if (preg_match('/^[\s]+/', $_POST['UserAdvManager_MailExclusion_List']))
+    {
+      array_push($page['errors'], l10n('mail_exclusionlist_error'));
+      $UserAdvManager_Exclusionlist_Error = true;
     }
 		
@@ -251,4 +259,5 @@
     'UserAdvManager_ERROR_REPORTS2'           => $UserAdvManager_ConfirmMail_Error_Txt,
     'UserAdvManager_ERROR_REPORTS3'           => $UserAdvManager_Reminder_Error_Txt,
+    'UserAdvManager_ERROR_REPORTS4'           => $UserAdvManager_Exclusionlist_Error,
     )
   );
@@ -314,6 +323,5 @@
 		  while($row = mysql_fetch_assoc($result))
 		  {
-				$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
-			  $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
+			  $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
 			  for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
 			  {
Index: /extensions/NBC_UserAdvManager/trunk/admin/global.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 4339)
+++ /extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 4340)
@@ -45,8 +45,14 @@
     	</li>
 
-{if $UserAdvManager_MAILEXCLUSION_TRUE}     
+{if $UserAdvManager_MAILEXCLUSION_TRUE}
+  {if $UserAdvManager_ERROR_REPORTS4}     
+    	<li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
+        <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea><br><br>
+    	</li>
+  {else}
     	<li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
         <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea><br><br>
     	</li>
+  {/if}
 {else}
     	<li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
Index: /extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php	(revision 4339)
+++ /extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php	(revision 4340)
@@ -609,12 +609,13 @@
   if (isset($username))
   {
+    $usercase = strtolower($username);
     $query = "
 SELECT ".$conf['user_fields']['username']."
   FROM ".USERS_TABLE."
-WHERE LOWER(".$conf['user_fields']['username'].") = '".strtolower($username)."'
-;";
-    list($username) = mysql_fetch_row(pwg_query($query));
-
-    return isset($username) ? stripslashes($username) : '';
+WHERE LOWER(".stripcslashes($conf['user_fields']['username']).") = '".$usercase."'
+;";
+    list($usercase) = mysql_fetch_row(pwg_query($query));
+
+    return isset($username) ? stripslashes($usercase) : '';
   }
 }
@@ -653,5 +654,5 @@
 	{
 		$ncsemail = strtolower($email);
-		$conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
+		$conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
 		for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
 		{
Index: /extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php	(revision 4339)
+++ /extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php	(revision 4340)
@@ -175,4 +175,7 @@
 /* TODO */$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.';
 // --------- End: New or revised $lang ---- from version 2.12.7
+// --------- Starting below: New or revised $lang ---- from version 2.12.8
+/* TODO */$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
 
 
Index: /extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 4339)
+++ /extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 4340)
@@ -176,4 +176,7 @@
 $lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.';
 // --------- End: New or revised $lang ---- from version 2.12.7
+// --------- Starting below: New or revised $lang ---- from version 2.12.8
+$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
 
 
Index: /extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php	(revision 4339)
+++ /extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php	(revision 4340)
@@ -176,4 +176,7 @@
 /* TODO */$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.';
 // --------- End: New or revised $lang ---- from version 2.12.7
+// --------- Starting below: New or revised $lang ---- from version 2.12.8
+/* TODO */$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
 
 
Index: /extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 4339)
+++ /extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 4340)
@@ -175,4 +175,7 @@
 $lang['mail_text_error'] = '<b>Attention!</b> - Le point-virgule (;) n\'est pas autorisé dans le texte additionnel des emails. Ce caractère a été automatiquement remplacé par un point (.). Pour information, le(s) texte(s) modifié(s) est(sont) affiché(s) en rouge dans le(s) champ(s) correspondant(s). Veuillez le(s) vérifier.';
 // --------- End: New or revised $lang ---- from version 2.12.7
+// --------- Starting below: New or revised $lang ---- from version 2.12.8
+$lang['mail_exclusionlist_error'] = 'Attention ! Vous avez saisi un retour à la ligne en début de liste d\'exclusion des domaines de messagerie (affichée en rouge ci-dessous). Bien que ce retour à la ligne ne soit pas visible, il est tout de même présent et est susceptible de provoquer des dysfonctionnements du plugin. Veuillez resaisir votre liste d\'exclusion en veillant à ne pas commencer par un retour à la ligne.';
+// --------- End: New or revised $lang ---- from version 2.12.8
 
 
Index: /extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php	(revision 4339)
+++ /extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php	(revision 4340)
@@ -176,4 +176,7 @@
 /* TODO */$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.';
 // --------- End: New or revised $lang ---- from version 2.12.7
+// --------- Starting below: New or revised $lang ---- from version 2.12.8
+/* TODO */$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
 
 
Index: /extensions/NBC_UserAdvManager/trunk/main.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 4339)
+++ /extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 4340)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: NBC UserAdvManager
-Version: 2.12.7
+Version: 2.12.8
 Description: Renforcer les possibilités de gestion des utilisateurs - Enforce users management
 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
@@ -77,7 +77,7 @@
 
 -- 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".
+            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)
@@ -105,4 +105,8 @@
             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
+
+-- 2.12.8 : Bug 1259 fixed - PHP notice on user addition by admin in user_list page
+            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 1260
 */
 
@@ -270,32 +274,4 @@
   {
     return l10n('reg_err_login5');
-  }
-
-  if (script_basename() == 'admin' and isset($_GET['page']) and $_GET['page'] == 'user_list') /* not the same email variable if we are on users registration page or on admin's user registration page*/
-  {
-    /* ***************************** */
-    /* Standard Piwigo's email check */
-    /* ***************************** */
-    $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
-    $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
-    $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
-  
-    if (!preg_match($regex, $_POST['email']))
-    {
-      return l10n('reg_err_mail_address');
-    }
-    
-    if (!empty($_POST['email']))
-    {
-      $query = '
-select count(*)
-from '.USERS_TABLE.'
-where upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['email'].'\');';
-      list($count) = mysql_fetch_assoc(pwg_query($query));
-      if ($count != 0)
-      {
-        return l10n('reg_err_mail_address_dbl');
-      }
-    }
   }
 /* ****************************************** */
