Index: extensions/NBC_UserAdvManager/admin/UserAdvManager_admin.php
===================================================================
--- extensions/NBC_UserAdvManager/admin/UserAdvManager_admin.php	(revision 3384)
+++ extensions/NBC_UserAdvManager/admin/UserAdvManager_admin.php	(revision 3385)
@@ -18,5 +18,5 @@
   $_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text']));
 
-    $newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'];
+    $newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'];
 
   $conf['nbc_UserAdvManager'] = $newconf_nbc_UserAdvManager;
@@ -140,20 +140,17 @@
     'UserAdvManager_NO_COMMENT_ANO_TRUE'  => $conf_nbc_UserAdvManager[6]=='true' ?  'checked="checked"' : '' ,
     'UserAdvManager_NO_COMMENT_ANO_FALSE' => $conf_nbc_UserAdvManager[6]=='false' ?  'checked="checked"' : '' ,
+    'UserAdvManager_MAILEXCLUSION_TRUE'   => $conf_nbc_UserAdvManager[12]=='true' ?  'checked="checked"' : '' ,
+    'UserAdvManager_MAILEXCLUSION_FALSE'  => $conf_nbc_UserAdvManager[12]=='false' ?  'checked="checked"' : '' ,
+    'UserAdvManager_MAILEXCLUSION_LIST'   => $conf_nbc_UserAdvManager[13],
   )
 );
 
-function Audit_UserAdvManager()
-{
-  global $page, $conf, $errors;
-
-  $page_UserAdvMAnager_admin = get_admin_plugin_menu_link(__FILE__);
-
+
+if ( isset($_POST['audit']) or isset($_POST['submit']) )
+{
   $msg_error1 = '';
-  $msg_error2 = '';
-  $msg_ok_Audit = '';
-  $msg_error_Audit = '';
-
-  /* Usename non case sensitive */  
-  if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true')
+    
+  /* username insensible a la casse */
+  if (isset($conf_nbc_UserAdvManager[3]) and $conf_nbc_UserAdvManager[3] == 'true')
   {
     $query = "
@@ -168,13 +165,15 @@
     ;";
     $result = pwg_query($query);
-  while($row = mysql_fetch_array($result))
-    $msg_error1 .= '<br/>'.l10n('Err_audit_no_casse').$row['username'];
-    
-  if ($msg_error1 == '')
-    array_push($page['infos'], l10n('UserAdvManager_audit_ok'));
-  else
-    $msg_error1 = l10n('Err_audit_no_casse').$row['username'];
-  }
-
+  
+    while($row = mysql_fetch_array($result))
+    {
+      $msg_error1 .= (($msg_error1 <> '') ? '<br/>' : '') . l10n('Err_audit_no_casse').$row['username'];
+    }
+  }
+
+
+
+  $msg_error2 = '';
+  
   /* Username without forbidden keys */
   if ( isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' )
@@ -186,28 +185,54 @@
     $result = pwg_query($query);
 
-  while($row = mysql_fetch_array($result))
-    $msg_error2 .= '<br/>'.l10n('Err_audit_username_char').$row['username'].' ('.$row['mail_address'].')';
-
-  if ($msg_error2 == '')
-    array_push($page['infos'], l10n('UserAdvManager_audit_ok'));
-  else
-    $msg_error2 = l10n('Err_audit_username_char').$row['username'].' ('.$row['mail_address'].')';
-  }
-
+    while($row = mysql_fetch_array($result))
+    {
+      if ( !ValidateUsername($row['username']) )
+        $msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char').$row['username'];
+    }
+  }
+
+
+  $msg_error3 = '';
+  
+  /* Email without forbidden domain */
+  if ( isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' )
+  {
+    $query = "
+      SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."
+      FROM ".USERS_TABLE."
+    ;";
+    $result = pwg_query($query);
+
+    while($row = mysql_fetch_array($result))
+    {
+    $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+	$conf_nbc_MailExclusion = split (",",$conf_nbc_UserAdvManager[13]);
+	for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+		{
+			if (ereg($conf_nbc_MailExclusion[$i], $row['mail_address']))
+			{
+        		$msg_error3 .=  (($msg_error3 <> '') ? '<br/>' : '') . l10n('Err_audit_email_forbidden').$row['username'].' ('.$row['mail_address'].')';
+			}
+		}
+    }
+  }
+   
   if ($msg_error1 <> '')
     $errors[] = $msg_error1.'<br/><br/>';
+
   if ($msg_error2 <> '')
     $errors[] = $msg_error2.'<br/><br/>';
 
-  if ($msg_error1 <> '' or $msg_error2 <> '')
-    $errors[] = l10n('Err_audit_advise');
+  if ($msg_error3 <> '')
+    $errors[] = $msg_error3.'<br/><br/>';
+
+
+  if ($msg_error1 <> '' or $msg_error2 <> '' or $msg_error3 <> '')
+    array_push($page['errors'], l10n('Err_audit_advise'));
   else
     array_push($page['infos'], l10n('UserAdvManager_audit_ok'));
 }
 
-if ( isset($_POST['audit']) or isset($_POST['submit']) )
-{
-	Audit_UserAdvManager();
-}
+
 // +-----------------------------------------------------------------------+
 // |                             errors display                            |
@@ -218,5 +243,5 @@
   foreach ($errors as $error)
   {
-    $template->assign('errors.error', array('ERROR'=>$error));
+  	array_push($page['errors'], $error);
   }
 }
Index: extensions/NBC_UserAdvManager/admin/UserAdvManager_admin.tpl
===================================================================
--- extensions/NBC_UserAdvManager/admin/UserAdvManager_admin.tpl	(revision 3384)
+++ extensions/NBC_UserAdvManager/admin/UserAdvManager_admin.tpl	(revision 3385)
@@ -56,5 +56,13 @@
         <input type="radio" value="false" {$UserAdvManager_NO_COMMENT_ANO_FALSE} name="UserAdvManager_No_Comment_Anonymous"/>{'UserAdvManager_No_Comment_Anonymous_false'|@translate}<br/>
     	</li>
-
+    	<br/>
+    	<li><label>{'UserAdvManager_MailExclusion'|@translate}</label><br/>
+        <input type="radio" value="true" {$UserAdvManager_MAILEXCLUSION_TRUE} name="UserAdvManager_MailExclusion"/>{'UserAdvManager_MailExclusion_true'|@translate}<br/>
+        <input type="radio" value="false" {$UserAdvManager_MAILEXCLUSION_FALSE} name="UserAdvManager_MailExclusion"/>{'UserAdvManager_MailExclusion_false'|@translate}<br/>
+    	<br/>
+    	<li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br/>
+        <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea>
+    	</li>
+    	</li>
     </ul>
   	<div align="center"><input class="submit" type="submit" value="{'audit'|@translate}" name="audit" /> <input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} /></div>
Index: extensions/NBC_UserAdvManager/include/functions_UserAdvManager.inc.php
===================================================================
--- extensions/NBC_UserAdvManager/include/functions_UserAdvManager.inc.php	(revision 3384)
+++ extensions/NBC_UserAdvManager/include/functions_UserAdvManager.inc.php	(revision 3385)
@@ -90,5 +90,5 @@
 {
   global $conf;
-   $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
   $Confirm_Mail_ID = FindAvailableConfirmMailID();
 
@@ -295,5 +295,5 @@
   global $conf;
 
-  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['UserAdvManager']) : array();
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
 
   if ( isset($login) and isset($conf_nbc_UserAdvManager[8]) and $conf_nbc_UserAdvManager[8] <> '' )
@@ -310,3 +310,21 @@
 }
 
+
+function ValidateEmailProvider($email)
+{
+  global $conf;
+
+	$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+	if (isset($conf_nbc_UserAdvManager[12]))
+	{
+		$conf_nbc_MailExclusion = split (",",$conf_nbc_UserAdvManager[13]);
+		for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+			{
+				if (ereg($conf_nbc_MailExclusion[$i], $email))
+        				return false;
+        			else
+      					return true;
+			}
+	}
+}
 ?>
Index: extensions/NBC_UserAdvManager/language/en_UK/plugin.lang.php
===================================================================
--- extensions/NBC_UserAdvManager/language/en_UK/plugin.lang.php	(revision 3384)
+++ extensions/NBC_UserAdvManager/language/en_UK/plugin.lang.php	(revision 3385)
@@ -41,7 +41,15 @@
 $lang['UserAdvManager_No_Comment_Anonymous_true'] = ' The author field have to be filled to send a comment.';
 $lang['UserAdvManager_No_Comment_Anonymous_false'] = ' Use the default Piwigo settings on comments sending.';
+$lang['UserAdvManager_MailExclusion'] = 'Email provider exclusion';
+$lang['UserAdvManager_MailExclusion_true'] = ' Set the email provider exclusion ON (i.e. : @hotmail.* or @msn.*)';
+$lang['UserAdvManager_MailExclusion_false'] = ' Set the email provider exclusion OFF.';
+$lang['UserAdvManager_MailExclusion_List'] = ' If email provider exclusion is set to ON, fill the email domains to exclude below. You have to use the following format :<br/>@[domaine_name].[domaine_extension] - Example : @hotmail.com<br/>Seperate the different domains with a comma (,)<br/>';
+
+$lang['audit'] = 'Audit';
+$lang['submit'] = 'Submit';
 
 $lang['Err_audit_no_casse'] = '<b>These accounts are identical to the case closely :</b> ';
 $lang['Err_audit_username_char'] = '<b>This account uses one or more forbidden characters :</b> ';
+$lang['Err_audit_email_forbidden'] = '<b>This account uses a forbidden email provider :</b> ';
 $lang['Err_audit_advise'] = '<b>you make a correction to comply with new rules that you have activated.<br>use a utility géstion database to correct user accounts directly in the table ### _USERS';
 $lang['UserAdvManager_audit_ok'] = 'Audit OK';
@@ -52,4 +60,6 @@
 if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
   $lang['reg_err_login5'] = 'user name is already taken, attention name is insensitive (Shift = Tiny).';
+$lang['reg_err_login6'] = 'Username does not contain the following characters: ';
+$lang['reg_err_login7'] = 'Your email provider is banned for registration. Banned email providers are: ';
 
 $lang['invalid_pwd'] = 'User name or password invalid !';
Index: extensions/NBC_UserAdvManager/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/NBC_UserAdvManager/language/fr_FR/plugin.lang.php	(revision 3384)
+++ extensions/NBC_UserAdvManager/language/fr_FR/plugin.lang.php	(revision 3385)
@@ -41,4 +41,8 @@
 $lang['UserAdvManager_No_Comment_Anonymous_true'] = ' Le champs auteur doit être renseigné pour enregistrer un commentaire.';
 $lang['UserAdvManager_No_Comment_Anonymous_false'] = ' Laisser le fonctionnement par défaut pour enregistrer un commentaire.';
+$lang['UserAdvManager_MailExclusion'] = 'Exclusion des domaines de messagerie';
+$lang['UserAdvManager_MailExclusion_true'] = ' Activer l\'exclusion des domaines de messagerie (par exemple @hotmail.* ou @msn.*)';
+$lang['UserAdvManager_MailExclusion_false'] = ' Désactiver l\'exclusion des domaines de messagerie.';
+$lang['UserAdvManager_MailExclusion_List'] = ' Si l\'exclusion de domaines de messagerie est activée, saisissez les domaines à exclure ici. Il faut respecter le format suivant :<br/>@[nom_du_domaine].[extension_du_domaine] - Exemple : @hotmail.com<br/>Séparez les domaines par une virgule<br/>';
 
 $lang['audit'] = 'Audit';
@@ -47,4 +51,5 @@
 $lang['Err_audit_no_casse'] = '<b>Ces comptes sont identiques à la casse près :</b> ';
 $lang['Err_audit_username_char'] = '<b>Ce compte contient un ou des caractères interdits :</b> ';
+$lang['Err_audit_email_forbidden'] = '<b>Ce compte contient des domaines de messagerie interdit :</b> ';
 $lang['Err_audit_advise'] = '<b>Vous avez des corrections a faire pour respecter les nouvelles règles que vous avez activé<br>utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.</b>';
 $lang['UserAdvManager_audit_ok'] = 'Audit OK';
@@ -56,4 +61,5 @@
 	$lang['new_reg_err_login5'] = 'ce nom utilisateur est déjà pris, ATTENTION le nom est insensible à la casse (Majuscule = Minuscule).';
 $lang['reg_err_login6'] = 'le nom utilisateur ne doit pas contenir les caractère suivants : ';
+$lang['reg_err_login7'] = 'L\'adresse email est issue d\'un prestataire interdit. Les prestataires d\'adresses email interdits à l\'inscription sont : ';
 
 $lang['invalid_pwd'] = 'Nom utilisateur ou Mot de passe invalide !';
Index: extensions/NBC_UserAdvManager/main.inc.php
===================================================================
--- extensions/NBC_UserAdvManager/main.inc.php	(revision 3384)
+++ extensions/NBC_UserAdvManager/main.inc.php	(revision 3385)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: NBC UserAdvManager
-Version: 2.10.8
+Version: 2.10.9
 Description: Permet de renforcer les possibilités de gestion des utilisateurs - Enforce users management
 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
@@ -29,4 +29,9 @@
 -- 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.
 
 */
@@ -53,5 +58,5 @@
     	++ (...)
 
--- Password control ans enforcement
+-- Password control and enforcement
   -- Empty password (done in Piwigo 2.x)
   ++ Can not be the same as username
@@ -127,4 +132,5 @@
 function UserAdvManager_InitPage()
 {
+  load_language('plugin.lang', NBC_UserAdvManager_PATH);
   global $conf, $template, $page, $lang;
 
@@ -172,4 +178,25 @@
         $_POST['login'] = '';
       }
+
+      /* Email without forbidden domains */
+      /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
+      //if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email']))
+      //{
+      //  $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+	  //  $_POST['login'] = '';
+	  //}
+      /* 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']))
+		{
+		  $conf_nbc_MailExclusion = split (",",$conf_nbc_UserAdvManager[13]);
+		  for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+		    {
+			  if (ereg($conf_nbc_MailExclusion[$i], $_POST['email']))
+			    {
+		          $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+		          $_POST['login'] = '';
+				}
+			}
+		}
     }
   }
@@ -194,4 +221,26 @@
         $_POST['login'] = '';
       }
+
+
+      /* Email without forbidden domains */
+      /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
+      //if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address']))
+      //{
+      //  $lang['reg_err_mail_address'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+      //  $_POST['mail_address'] = '';
+      //}
+      /* 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']))
+		  {
+		    $conf_nbc_MailExclusion = split (",",$conf_nbc_UserAdvManager[13]);
+			for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+			  {
+			    if (ereg($conf_nbc_MailExclusion[$i], $_POST['mail_address']))
+				  {
+				    $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+					$_POST['login'] = '';
+				  }
+			  }
+		  }
     }
   }
@@ -247,5 +296,30 @@
             $errors[] = $mail_error;
           }
-        }
+        /* This don't work on user's profile page - Why ?? */
+		if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+		  {
+		    $conf_nbc_MailExclusion = split (",",$conf_nbc_UserAdvManager[13]);
+			for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+			  {
+			    if (ereg($conf_nbc_MailExclusion[$i], $_POST['mail_address']))
+				  {
+				    $mail_error = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+				  }
+			  }
+		  }
+	      if (!empty($mail_error))
+          {
+            $errors[] = $mail_error;
+          }
+        }
+		/* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
+        //if (isset($_POST['mail_address']))
+        //{
+        //  $mail_error = ValidateEmailProvider($_POST['mail_address']);
+        //  if (!empty($mail_error))
+        //  {
+        //    $errors[] = $mail_error;
+        //  }
+        //}
 
         $typemail = 3;
Index: extensions/NBC_UserAdvManager/maintain.inc.php
===================================================================
--- extensions/NBC_UserAdvManager/maintain.inc.php	(revision 3384)
+++ extensions/NBC_UserAdvManager/maintain.inc.php	(revision 3385)
@@ -10,5 +10,5 @@
   $q = '
     INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
-    VALUES ("nbc_UserAdvManager","true;false;false;-1;-1;-1;false;false;;-1;;","Parametres du plugin nbc UserAdvManager")
+    VALUES ("nbc_UserAdvManager","true;false;false;-1;-1;-1;false;false;;-1;;;false;;","Parametres du plugin nbc UserAdvManager")
   ;';
   pwg_query($q);
