Index: /extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php	(revision 5064)
@@ -95,5 +95,5 @@
   case 'global':
 
-	if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_No_Casse']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_No_Comment_Anonymous']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker']))
+	if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_No_Casse']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_No_Comment_Anonymous']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker']) and isset($_POST['UAM_Admin_ConfMail']))
   {
 
@@ -158,5 +158,6 @@
       $_POST['UAM_GhostTracker_DayLimit'],
       $_POST['UAM_GhostTracker_ReminderText'],
-      $_POST['UAM_Add_LastVisit_Column']);
+      $_POST['UAM_Add_LastVisit_Column'],
+      $_POST['UAM_Admin_ConfMail']);
 
     $conf['nbc_UserAdvManager'] = serialize($newconf_UAM);
@@ -362,4 +363,6 @@
     'UAM_ADDLASTVISIT_TRUE'          => $conf_UAM[20]=='true' ?  'checked="checked"' : '' ,
     'UAM_ADDLASTVISIT_FALSE'         => $conf_UAM[20]=='false' ?  'checked="checked"' : '' ,
+    'UAM_ADMINCONFMAIL_TRUE'         => $conf_UAM[21]=='true' ?  'checked="checked"' : '' ,
+    'UAM_ADMINCONFMAIL_FALSE'        => $conf_UAM[21]=='false' ?  'checked="checked"' : '' ,
 		'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score,
     'UAM_ERROR_REPORTS1'             => $UAM_MailInfo_Error_Txt,
Index: /extensions/NBC_UserAdvManager/trunk/admin/global.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 5064)
@@ -138,4 +138,8 @@
 
         <ul>
+       	  <li><label class="cluetip" title="{'UAM_adminconfmailTitle'|translate}|{'UAM_adminconfmailTitle_d'|translate}">{'UAM_AdminConfMail'|@translate}</label><br><br>
+            <input type="radio" value="false" {$UAM_ADMINCONFMAIL_FALSE} name="UAM_Admin_ConfMail">{'UAM_Admin_ConfMail_false'|@translate}<br>
+            <input type="radio" value="true" {$UAM_ADMINCONFMAIL_TRUE} name="UAM_Admin_ConfMail">{'UAM_Admin_ConfMail_true'|@translate}<br><br>
+          </li>
 {if $UAM_CONFIRM_MAIL_TRUE}
   {if $UAM_ERROR_REPORTS2}     
Index: /extensions/NBC_UserAdvManager/trunk/changelog.txt.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/changelog.txt.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/changelog.txt.php	(revision 5064)
@@ -3,5 +3,7 @@
 Plugin Name: NBC_UserAdvManager
 ** Change log **
+***************************************
 ***** Plugin history (branch 2.10)*****
+***************************************
 
 -- 2.10.0-beta : Initial beta release for Piwigo compatibility
@@ -67,5 +69,7 @@
 
 
+***************************************
 ***** Plugin history (branch 2.12)*****
+***************************************
 
 -- 2.12.0 : Bug 1206 fixed : All plugin functionnalities work in user's profile page
@@ -100,5 +104,7 @@
 
 
+***************************************
 ***** Plugin history (branch 2.13)*****
+***************************************
  
 -- 2.13.0 : Bug 1246 fixed - Extended Description tags are working again ! Caution : The language used and saved in database is the one configured by default in the visitor's browser and not the language given by Language Switch.
@@ -123,5 +129,5 @@
 
 -- 2.13.4 : Add of obsolete files management
-            Bug 1303 and 1387 fixed - Due to a bug in Piwigo's 2.0.8 switch_lang() function, the email contents using Extended Description tags wasn't taking user's language in account. A frist fix is now set for the current 2.0.8 Piwigo's version and another one is ready to work for the next Piwigo's release.
+            Bug 1303 and 1387 fixed - Due to a bug in Piwigo's 2.0.8 switch_lang() function, the email contents using Extended Description tags wasn't taking user's language in account. A first fix is now set for the current 2.0.8 Piwigo's version and another one is ready to work for the next Piwigo's release.
             Bug 1444 fixed
             Bug 1445 fixed - The plugin's administration panel have been all reviewed and improved with text simplification and display enhancement.
@@ -129,4 +135,18 @@
             
             *** Feature temporarily postponed in a later version due to problems with ";" in text fields *** Add compatibility with FCK Editor plugin for email text fields
+
+
+***************************************
+***** Plugin history (branch 2.14)*****
+***************************************
+
+-- 2.14.0 : Bug 1308 refixed - Piwigo 2.0.9 fixes the bug on switch_lang() function so the initial UAM fix is no longer needed 
+            Evolution 1392 - No more confirmation email for admins profile changing 
+            Evolution 1465 - Plugin's configuration data are now serialized in database
+            Bug 1466 fixed - The plugin version is correctly displayed on Ghost Tracker tab
+            Bug 1468 fixed - Java error (thx to cljosse)
+            Evolution 1485 - The admin's can choose if the validation of registration have to be sent to users created by them
+            Improving obsolete files cleaning
+            Code simplification - All variables are changed from "UserAdvManager" to "UAM"
 */
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/include/functions.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/include/functions.inc.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/include/functions.inc.php	(revision 5064)
@@ -7,11 +7,5 @@
 {
   /* Only available for next Piwigo release (bug in switch_lang function) */
-  //global $conf;
-  
-  /* ****************************************************************** */
-  /* Delete this after new Piwigo release (bug in switch_lang function) */
-  global $conf, $user;
-  $save_user = $user; 
-  /* ****************************************************************** */
+  global $conf;
 
   $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
@@ -122,8 +116,4 @@
 
 /* Switching back to default language */
-  /* ****************************************************************** */
-  /* Delete this after new Piwigo release (bug in switch_lang function) */
-$user=$save_user ;
-  /* ****************************************************************** */
 switch_lang_back();
 }
@@ -134,11 +124,5 @@
 {
   /* Only available for next Piwigo release (bug in switch_lang function) */
-  //global $conf;
-  
-  /* ****************************************************************** */
-  /* Delete this after new Piwigo release (bug in switch_lang function) */
-  global $conf, $user;
-  $save_user = $user; 
-  /* ****************************************************************** */
+  global $conf;
 
   $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
@@ -234,8 +218,4 @@
 
 /* Switching back to default language */
-  /* ****************************************************************** */
-  /* Delete this after new Piwigo release (bug in switch_lang function) */
-$user=$save_user ;
-  /* ****************************************************************** */
 switch_lang_back();
 }
@@ -246,11 +226,5 @@
 {
   /* Only available for next Piwigo release (bug in switch_lang function) */
-  //global $conf;
-  
-  /* ****************************************************************** */
-  /* Delete this after new Piwigo release (bug in switch_lang function) */
-  global $conf, $user;
-  $save_user = $user; 
-  /* ****************************************************************** */
+  global $conf;
 
   $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
@@ -306,8 +280,4 @@
 
 /* Switching back to default language */
-  /* ****************************************************************** */
-  /* Delete this after new Piwigo release (bug in switch_lang function) */
-$user=$save_user ;
-  /* ****************************************************************** */
 switch_lang_back();
 }
@@ -500,5 +470,5 @@
 
 /*              Time limit process              */
-/* ****************** begin ******************* */  
+/* ******************************************** */  
       if (!empty($registration_date))
       {
@@ -985,5 +955,5 @@
 
 /*              Time limit process              */
-/* ****************** begin ******************* */  
+/* ******************************************** */  
 	if (!empty($registration_date))
   {
@@ -1106,5 +1076,5 @@
    fwrite($fo, 'Langue : '."\n" . $language . "\r\n") ;
    fclose($fo) ;
- //return mail ($to,$subject) ;
+   //return mail ($to,$subject) ;
 }
 
@@ -1155,47 +1125,21 @@
 }
 
-/* Funtion called in maintain.inc.php to clean obsolete files */
-function clean_obsolete_files($obsolete_file_list)
-{
-  if (!file_exists(NBC_UAM_PATH.$obsolete_file_list))
-  {
-    return TRUE;
-  }
-  $obsolete = file(NBC_UAM_PATH.$obsolete_file_list);
-  array_push($obsolete, $obsolete_file_list);
-  return clean_obsolete_list($obsolete);
-}
-
-function clean_obsolete_list($file_list = array(), &$errors = array())
-{
-  if (!function_exists('unlink'))
-  {
-      // No unlink available...
-      array_push($errors, l10n('uam_no_unlink'));
-      return FALSE;
-  }
-  $success = TRUE;
-  foreach ($file_list as $file)
-  {
-    $file = NBC_UAM_PATH . $file;
-  $to = '';
-  $subject ='';
-  $language = '';
-  MailLog  ($to, $subject, $file, $language);
-    //if (file_exists($file))
-    //{
-      // Remove obsolete file
-      $success &= unlink($file);
-  $to = '';
-  $subject ='';
-  $language = '';
-  MailLog  ($to, $subject, $file, $success);
-    //}
-  }
-  if (!$success)
-  {
-      array_push($errors, l10n('uam_unlink_errors'));
-  }
-  return $success;
+
+function clean_obsolete_files()
+{
+  if (file_exists(NBC_UAM_PATH.'obsolete.list')
+    and $old_files = file(NBC_UAM_PATH.'obsolete.list', FILE_IGNORE_NEW_LINES)
+    and !empty($old_files))
+  {
+    array_push($old_files, 'obsolete.list');
+    foreach($old_files as $old_file)
+    {
+      $path = NBC_UAM_PATH.$old_file;
+      if (is_file($path))
+      {
+        @unlink($path);
+      }
+    }
+  }
 }
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/de_DE/help/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/de_DE/help/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/de_DE/help/plugin.lang.php	(revision 5064)
@@ -136,3 +136,11 @@
 <br>
 - Generieren Sie per E-Mail-Erinnerung <b>mit dem Zurücksetzen der letzte Besuch date</b>. Dies erlaubt es, einen Platzhalter, um die angestrebten Besucher geben. Wenn der Besucher bereits eine Mahnung erhalten haben, durch nichts daran gehindert, eine neue Mail, die wieder zurückgesetzt werden, in der Tat übel, dem letzten Tag besuchen.';
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_adminconfmailTitle'] = 'Best&auml;tigung der Anmeldung f&uuml;r Administratoren';
+$lang['UAM_adminconfmailTitle_d'] = 'Sie k&ouml;nnen diese Validierung deaktivieren nur f&uuml;r Benutzer-Accounts durch den Administrator &uuml;ber Piwigo\'s Benutzer-Management-Schnittstelle geschaffen.<br><br>
+Bei Aktivierung dieser Option, E-Mail-Best&auml;tigung f&uuml;r die Registrierung wird f&uuml;r jeden Benutzer vom Administrator erstellt wurde gesendet werden.<br><br>
+Durch die Deaktivierung dieser Option (Standard), nur die E-Mail-Informationen gesendet werden (wenn &quot;Informations-E-Mail an Benutzer&quot; aktiviert ist).';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php	(revision 5064)
@@ -263,3 +263,10 @@
 $lang['Err_Userlist_Settings'] = 'Diese Seite ist nur verfügbar, wenn &quot;Monitoring registrierte Benutzer&quot; ist aktiv in der &quot;Einstellung der Registrierung durchgeführt und andere Optionen&quot;';
 // --------- End: New or revised $lang ---- from version 2.13.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_AdminConfMail'] = 'Bestätigung der Anmeldung für Administratoren';
+$lang['UAM_Admin_ConfMail_true'] = ' Aktivieren';
+$lang['UAM_Admin_ConfMail_false'] = '  Deaktivieren (Standard)';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/en_UK/help/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/en_UK/help/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/en_UK/help/plugin.lang.php	(revision 5064)
@@ -136,3 +136,11 @@
 <br>
 - Generate email reminder <b>with resetting the last visit date</b>. This allows to give a wildcard to targeted visitors. If the visitor has already received a reminder, nothing prevents to resent a new mail which will reset again, in fact, the last visit date.';
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_adminconfmailTitle'] = 'Confirmation of registration for admins';
+$lang['UAM_adminconfmailTitle_d'] = 'You can disable this validation only for user accounts created by the administrator via Piwigo\'s users management interface.<br><br>
+By activating this option, email validation for registration will be sent to each user created by admin.<br><br>
+By disabling this option (default), only the email information is sent (if &quot;Information email to user&quot; is enabled).';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 5064)
@@ -263,3 +263,10 @@
 $lang['Err_Userlist_Settings'] = 'This page is available only if "Monitoring registered users" is active in the "Setting the registrations followed and other options".';
 // --------- End: New or revised $lang ---- from version 2.13.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_AdminConfMail'] = 'Confirmation of registration for admins';
+$lang['UAM_Admin_ConfMail_true'] = ' Enable';
+$lang['UAM_Admin_ConfMail_false'] = ' Disable (default)';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/es_ES/help/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/es_ES/help/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/es_ES/help/plugin.lang.php	(revision 5064)
@@ -136,3 +136,11 @@
 <br>
 - Generar recordatorio por correo electrónico <b>con el cambio de la fecha última visita</b>. Esto permite dar un comodín a los visitantes específicos. Si el visitante ya ha recibido un recordatorio, nada impide a resentir un nuevo correo que se restablecerá de nuevo, de hecho, la fecha de la última visita.';
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_adminconfmailTitle'] = 'Confirmaci&oacute;n de registro por los administradores';
+$lang['UAM_adminconfmailTitle_d'] = 'Puede desactivar esta validaci&oacute;n s&oacute;lo para las cuentas de usuario creadas por el administrador de Piwigo a trav&eacute;s de la interfaz de gesti&oacute;n de los usuarios.<br><br>
+Al activar esta opci&oacute;n, la validaci&oacute;n del email de registro ser&aacute; enviado a cada usuario creado por el administrador.<br><br>
+Al deshabilitar esta opci&oacute;n (por defecto), s&oacute;lo la informaci&oacute;n que se env&iacute;e (si &quot;Informaci&oacute;n por correo electr&oacute;nico para el usuario&quot; est&aacute; activado).';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php	(revision 5064)
@@ -263,3 +263,10 @@
 $lang['Err_Userlist_Settings'] = 'Esta página está disponible sólo si "Seguimiento de los usuarios registrados" está activo en la "Configuración de los registros seguido y otras opciones".';
 // --------- End: New or revised $lang ---- from version 2.13.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_AdminConfMail'] = 'Confirmación de registro por los administradores';
+$lang['UAM_Admin_ConfMail_true'] = ' Activar';
+$lang['UAM_Admin_ConfMail_false'] = ' Desactivar (por defecto)';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/fr_FR/help/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/fr_FR/help/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/fr_FR/help/plugin.lang.php	(revision 5064)
@@ -133,3 +133,11 @@
 <br>
 - Générer l\'email de rappel <b>avec réinitialisation de la date de dernière visite</b>. Ce qui permet de donner un &quot;joker&quot; au visiteur ciblé. Si le visiteur a déjà bénéficié d\'un mail de rappel, rien n\'empêche de renvoyer un nouveau mail qui réinitialisera, de fait, la date de dernière visite.';
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_adminconfmailTitle'] = 'Validation d\'inscription pour les admins';
+$lang['UAM_adminconfmailTitle_d'] = 'On peut ici désactiver la validation des inscriptions uniquement pour les comptes d\'utilisateurs créés par l\'administrateur via l\'interface de gestion des utilisateurs de Piwigo.<br><br>
+En activant cette option, l\'email de validation d\'inscription sera envoyé à chaque utilisateur créé par l\'admin.<br><br>
+En désactivant cette option (mode par défaut), seul l\'email d\'information est envoyé (si la fonction &quot;Email d\'information &agrave; l\'utilisateur&quot; est activée).';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 5064)
@@ -263,3 +263,10 @@
 $lang['Err_Userlist_Settings'] = 'Cette page n\'est accessible que si le "Suivi des utilisateurs inscrits" est actif dans "Paramétrage des suivis des inscrits et autres options".';
 // --------- End: New or revised $lang ---- from version 2.13.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_AdminConfMail'] = 'Validation d\'inscription pour les admins';
+$lang['UAM_Admin_ConfMail_true'] = ' Activer';
+$lang['UAM_Admin_ConfMail_false'] = ' Désactiver (valeur par défaut)';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/it_IT/help/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/it_IT/help/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/it_IT/help/plugin.lang.php	(revision 5064)
@@ -136,3 +136,11 @@
 <br>
 - Generate email reminder <b>with resetting the last visit date</b>. This allows to give a wildcard to targeted visitors. If the visitor has already received a reminder, nothing prevents to resent a new mail which will reset again, in fact, the last visit date.';
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_adminconfmailTitle'] = 'Conferma della registrazione per gli amministratori';
+$lang['UAM_adminconfmailTitle_d'] = '&Egrave; possibile disattivare la convalida solo per gli account utente creato dall\'amministratore Piwigo tramite l\'interfaccia di gestione di utenti.<br><br>
+Attivando questa opzione, la convalida e-mail di registrazione verr&agrave; inviato ad ogni utente creato da admin.<br><br>
+Disabilitando questa opzione ((predefinito)), solo le informazioni e-mail viene inviata (se &quot;E-mail informazioni per l\'utente&quot; &egrave; abilitato).';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php	(revision 5064)
@@ -263,3 +263,10 @@
 $lang['Err_Userlist_Settings'] = 'Questa pagina è disponibile solo se "Controllo di utenti registrati" è attiva nella sezione "Impostazione delle registrazioni seguiti e altre opzioni".';
 // --------- End: New or revised $lang ---- from version 2.13.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.14.0
+$lang['UAM_AdminConfMail'] = 'Conferma della registrazione per gli amministratori';
+$lang['UAM_Admin_ConfMail_true'] = ' Consentire';
+$lang['UAM_Admin_ConfMail_false'] = ' Disattivare (predefinito)';
+// --------- End: New or revised $lang ---- from version 2.14.0
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/main.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 5064)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: NBC UserAdvManager
-Version: 2.13.5
+Version: 2.14.0
 Description: Renforcer la gestion des utilisateurs - Enforce users management
 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
@@ -119,11 +119,23 @@
   
   /* Sending registration confirmation by email */
-  if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true' and !is_admin()) or (isset($conf_UAM[2]) and $conf_UAM[2] == 'true' and !is_admin()))
-  {
+  if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[2]) and $conf_UAM[2] == 'true'))
+  {
+    if (is_admin() and isset($conf_UAM[21]) and $conf_UAM[21] == 'true')
+    {
+    $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
+    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true); 
+    }
+    elseif (is_admin() and isset($conf_UAM[21]) and $conf_UAM[21] == 'false')
+    {
+    $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
+    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
+    }
+    elseif (!is_admin())
+    {
     $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
-  }
-}
-
+    }
+  }
+}
 
 
Index: /extensions/NBC_UserAdvManager/trunk/maintain.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/maintain.inc.php	(revision 5063)
+++ /extensions/NBC_UserAdvManager/trunk/maintain.inc.php	(revision 5064)
@@ -8,4 +8,5 @@
 include_once (NBC_UAM_PATH.'include/constants.php');
 include_once (NBC_UAM_PATH.'include/functions.inc.php');
+
 
 function plugin_install()
@@ -21,5 +22,5 @@
 Best regards,
 
-The admin of the gallery.','false');
+The admin of the gallery.','false','false');
 
   $q = '
@@ -28,18 +29,5 @@
   ;';
   pwg_query($q);
-  
-/*  $q = '
-INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
-VALUES ("nbc_UserAdvManager","false;false;false;-1;-1;-1;false;false;;-1;;;false;;false;100;false;false;10;Hello.
-	
-This is a reminder because a very long time passed since your last visit on our gallery. If you do not want anymore to use your access account, please let us know by replying to this email. Your account will be deleted.
-
-On receipt of this message and no new visit within 15 days, we would be obliged to automatically delete your account.
-
-Best regards,
-
-The admin of the gallery.;false","Parametres du plugin nbc UserAdvManager")
-  ;';
-  pwg_query($q);*/
+
 
   $default2 = array('false',5,'Hello.
@@ -59,18 +47,4 @@
   pwg_query($q);
 
-
-/*  $q = '
-INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
-VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;Hello.
-		
-This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You have again 5 days to validate your registration.
-
-Note: After this period, your account will be permanently deleted.;false;Hello.
-
-This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key will expire. To allow you access to our gallery, you have 2 days to confirm your registration by clicking on the link in the message you should have received when you registered.
-
-Note: After this period, your account will be permanently deleted.","Parametres nbc_UserAdvManager - ConfirmMail")
-  ;';
-  pwg_query($q);*/
 
 	$q = "
@@ -98,14 +72,17 @@
 }
 
+
 function plugin_activate()
 {
-	  global $conf;
+  global $conf;
 
 /* Cleaning obsolete files */
-    update_files($plugin_id);
+/* *********************** */
+  clean_obsolete_files();
 
 
 /* Check for upgrade from 2.10 to 2.11 */
-	  $query = '
+/* *********************************** */
+	$query = '
 SELECT *
   FROM '.CONFIG_TABLE.'
@@ -116,5 +93,6 @@
 	if ($count == 0)
 	{
-	 /* upgrade from branch 2.10 to 2.11 */
+  /* upgrade from branch 2.10 to 2.11 */
+  /* ******************************** */
 		upgrade_210();
 	}
@@ -122,7 +100,9 @@
 
 /* Check for upgrade from 2.11 to 2.12 */
+/* *********************************** */
   if (!table_exist(USER_LASTVISIT_TABLE))
   {
-    /* upgrade from branch 2.11 to 2.12 */
+  /* upgrade from branch 2.11 to 2.12 */
+  /* ******************************** */
 		upgrade_211();
   }
@@ -130,4 +110,5 @@
 
 /* Check for upgrade from 2.12 to 2.13 */
+/* *********************************** */
   $query = '
 SELECT *
@@ -141,32 +122,17 @@
   if ($numfields < 6)
   {
-    /* upgrade from branch 2.12 to 2.13 */
+  /* upgrade from branch 2.12 to 2.13 */
+  /* ******************************** */
     upgrade_212();
   }
 
 
-/* Serializing conf parameters - Available since 2.13.5 */
+/* Serializing conf parameters - Available since 2.14.0 */
+/* **************************************************** */
   if (unserialize($conf['nbc_UserAdvManager']) === false)
   {
-    $data = explode(';', $conf['nbc_UserAdvManager']);
-
-    $query = '
-UPDATE '.CONFIG_TABLE.'
-  SET value = "'.addslashes(serialize($data)).'"
-  WHERE param = "nbc_UserAdvManager"
-;';
-    pwg_query($query);
-  }
-  
-  if (unserialize($conf['nbc_UserAdvManager_ConfirmMail']) === false)
-  {
-    $data = explode(';', $conf['nbc_UserAdvManager_ConfirmMail']);
-
-    $query = '
-UPDATE '.CONFIG_TABLE.'
-  SET value = "'.addslashes(serialize($data)).'"
-  WHERE param = "nbc_UserAdvManager_ConfirmMail"
-;';
-    pwg_query($query);
+  /* upgrade from branch 2.13 to 2.14 */
+  /* ******************************** */
+    upgrade_213();
   }
 }
@@ -205,5 +171,10 @@
 
 
+// +----------------------------------------------------------+
+// |       Upgrading database from old plugin versions        |
+// +----------------------------------------------------------+
+
 /* upgrade from branch 2.10 to 2.11 */
+/* ******************************** */
 function upgrade_210()
 {
@@ -229,4 +200,5 @@
 
 /* upgrade from branch 2.11 to 2.12 */
+/* ******************************** */
 function upgrade_211()
 {
@@ -271,4 +243,5 @@
 
 /* upgrade from branch 2.12 to 2.13 */
+/* ******************************** */
 function upgrade_212()
 {
@@ -297,10 +270,34 @@
 ;';
 		pwg_query($query);
-  }
-}
-
-function update_files($plugin_id)
-{
-  $clean = clean_obsolete_files(UAM_OBSOLETE);
+    
+    upgrade_213();
+  }
+}
+
+
+/* upgrade from branch 2.13 to 2.14 */
+/* ******************************** */
+function upgrade_213()
+{
+  $data = explode(';', $conf['nbc_UserAdvManager']);
+
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value = "'.addslashes(serialize($data)).'"
+  WHERE param = "nbc_UserAdvManager"
+;';
+  pwg_query($query);
+  
+  if (unserialize($conf['nbc_UserAdvManager_ConfirmMail']) === false)
+  {
+    $data = explode(';', $conf['nbc_UserAdvManager_ConfirmMail']);
+
+    $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value = "'.addslashes(serialize($data)).'"
+  WHERE param = "nbc_UserAdvManager_ConfirmMail"
+;';
+    pwg_query($query);
+  }
 }
 ?>
