Index: /extensions/UserAdvManager/trunk/admin/UAM_admin.php
===================================================================
--- /extensions/UserAdvManager/trunk/admin/UAM_admin.php	(revision 12313)
+++ /extensions/UserAdvManager/trunk/admin/UAM_admin.php	(revision 12314)
@@ -269,15 +269,21 @@
     $Backup_File = UAM_PATH.'/include/backup/UAM_dbbackup.sql';
 
-    if (file_exists($Backup_File))
-    {
-      $restore = UAM_Restore_backup_file();
-      if(empty($restore))
+    if (file_exists($Backup_File) and $file = file($Backup_File, FILE_IGNORE_NEW_LINES) and !empty($file))
+    {
+      // Check backup file version
+      // -------------------------
+      if ($file[0] == "-- ".$version." --")
       {
-        array_push($page['infos'], l10n('UAM_Restoration_OK'));
+        $restore = UAM_Restore_backup_file();
+        if(empty($restore))
+        {
+          array_push($page['infos'], l10n('UAM_Restoration_OK'));
+        }
+        else
+        {
+          array_push($page['errors'], l10n('UAM_Restoration_NOK'));
+        }
       }
-      else
-      {
-        array_push($page['errors'], l10n('UAM_Restoration_NOK'));
-      }
+      else array_push($page['errors'], l10n('UAM_Bad_version_backup'));
     }
     else
Index: /extensions/UserAdvManager/trunk/changelog.txt.php
===================================================================
--- /extensions/UserAdvManager/trunk/changelog.txt.php	(revision 12313)
+++ /extensions/UserAdvManager/trunk/changelog.txt.php	(revision 12314)
@@ -261,6 +261,8 @@
 -- 2.20.11 : Bug 2336 fixed - New feature : Add [Kdays] autotext flag to insert the number of days until expiration.
 
--- 2.30.0 :
-            Piwigo 2.3.0 compliant
+**************************************************************
+***** Plugin history (branch 2.30 - Piwigo 2.3 compliant)*****
+**************************************************************
+-- 2.30.0 : Piwigo 2.3.0 compliant
             Bug 2415 fixed - New feature : Set automatically privacy level for users who have validated or not their registration. Automated task available.
             Bug 2437 fixed - New feature : Request password renewal for selected users in Piwigo's users management panel.
@@ -269,4 +271,7 @@
             Bug 2450 fixed - New feature : Backup file restoration.
             Help files remaned and relocated in the language root directory (no more "help" subdirectory) for compliance with the new online translation tool.
+
+-- 2.30.1 : Bug 2455 fixed - Exclusion of specific users (généric and admins users) for password reset function.
+            Bug 2451 fixed - Unable to handle Sql errors but control of backup file validity have been enforced.
 */
 ?>
Index: /extensions/UserAdvManager/trunk/include/functions.inc.php
===================================================================
--- /extensions/UserAdvManager/trunk/include/functions.inc.php	(revision 12313)
+++ /extensions/UserAdvManager/trunk/include/functions.inc.php	(revision 12314)
@@ -399,5 +399,5 @@
   // -----------------------------------------------------
   if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
-  {  
+  {
     $query ='
 SELECT user_id, status
@@ -426,5 +426,5 @@
     $data = pwg_db_fetch_assoc(pwg_query($query));
 
-    if ($data['status'] <> "admin" and $data['status'] <> "webmaster" and $data['status'] <> "generic") // Exclusion of specific accounts
+    if ($data['status'] <> "webmaster" and $data['status'] <> "generic") // Exclusion of specific accounts
     {
       if (UAM_check_pwgreset($user['id']))
@@ -2800,5 +2800,8 @@
 {
   global $conf;
-  
+
+  $plugin =  PluginInfos(UAM_PATH);
+  $version = $plugin['version'];
+
   // Initial backup folder creation and file initialisation
   // ------------------------------------------------------
@@ -2810,4 +2813,7 @@
   $fp = fopen($Backup_File, 'w');
 
+  // Writing plugin version
+  $insertions = "-- ".$version." --\n\n";
+  fwrite($fp, $insertions);
 
   // Saving UAM specific tables
Index: /extensions/UserAdvManager/trunk/language/en_UK/help.lang.php
===================================================================
--- /extensions/UserAdvManager/trunk/language/en_UK/help.lang.php	(revision 12313)
+++ /extensions/UserAdvManager/trunk/language/en_UK/help.lang.php	(revision 12314)
@@ -330,5 +330,5 @@
 - Password renewed: The password has been renewed after a request.<br>
 - Original Password: The original password chosen at account creation and has never been required for a renewal.<br>
-The webmaster, administrators and guest accounts are excluded from this function.<br>
+Webmaster, generic and guest accounts are excluded from this function.<br>
 These users will be automatically redirected to their customization page at each of their connections until they changed their password and an explicit message will be displayed on this page.';
 $lang['UAM_DumpTitle'] = 'Backup and restore your configuration';
Index: /extensions/UserAdvManager/trunk/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 12313)
+++ /extensions/UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 12314)
@@ -76,5 +76,4 @@
 /* Action button names */
 $lang['UAM_audit'] = 'Audit settings';
-$lang['UAM_submit'] = 'Save settings';
 // --------- End: New or revised $lang ---- from version 2.12.0 and 2.12.1
 
@@ -400,3 +399,11 @@
 $lang['UAM_Restoration_OK'] = 'Restoring your configuration completed successfully! Please reload UAM\'s administration page to view the restored settings.';
 // --------- End: New or revised $lang ---- from version 2.30.0
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.30.1
+$lang['UAM_submit'] = 'Submit settings';
+$lang['UAM_Generic cannot be pwdreset'] = 'Password renewal can\'t be set for generic accounts!';
+$lang['UAM_Admins cannot be pwdreset'] = 'Password renewal can\'t be set for admins account!';
+$lang['UAM_Bad_version_backup'] = 'The version of the backup file does not match the version of the plugin! The restoration was not performed.';
+// --------- End: New or revised $lang ---- from version 2.30.1
 ?>
Index: /extensions/UserAdvManager/trunk/language/fr_FR/help.lang.php
===================================================================
--- /extensions/UserAdvManager/trunk/language/fr_FR/help.lang.php	(revision 12313)
+++ /extensions/UserAdvManager/trunk/language/fr_FR/help.lang.php	(revision 12314)
@@ -326,5 +326,5 @@
 - Mot de passe modifié : Le mot de passe a été changé suite à une demande.<br>
 - Mot de passe original : Le mot de passe est celui choisi à la création du compte et n\'a jamais fait l\'objet d\'une demande de changement.<br>
-Le compte du webmaster, des administrateurs et de l\'invité (Guest) sont exclus de cette fonction.<br><br>
+Le compte webmaster, génériques et invités (Guest) sont exclus de cette fonction.<br><br>
 Ces utilisateurs seront alors systématiquement redirigés vers leur page de personnalisation à chacune de leurs connexions tant qu\'ils n\'auront pas modifié leur mot de passe. Un message explicite sera affiché sur cette page.';
 $lang['UAM_DumpTitle'] = 'Sauvegarde et restauration de votre configuration';
Index: /extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 12313)
+++ /extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 12314)
@@ -76,5 +76,4 @@
 /* Action button names */
 $lang['UAM_audit'] = 'Auditer les paramètres';
-$lang['UAM_submit'] = 'Sauvegarder les paramètres';
 // --------- End: New or revised $lang ---- from version 2.12.0 and 2.12.1
 
@@ -397,3 +396,11 @@
 $lang['UAM_Restoration_OK'] = 'La restauration de votre configuration s\'est terminée avec succès ! Veuillez recharger la page d\'administration de UAM pour voir les paramètres restaurés.';
 // --------- End: New or revised $lang ---- from version 2.30.0
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.30.1
+$lang['UAM_submit'] = 'Enregistrer les paramètres';
+$lang['UAM_Generic cannot be pwdreset'] = 'Le renouvellement de mot de passe ne peut pas être demandé pour un compte générique !';
+$lang['UAM_Admins cannot be pwdreset'] = 'Le renouvellement de mot de passe ne peut pas être demandé pour un compte d\'administrateur !';
+$lang['UAM_Bad_version_backup'] = 'La version du fichier de sauvegarde ne correspond pas à la version du plugin ! La restauration n\'a pas été réalisée.';
+// --------- End: New or revised $lang ---- from version 2.30.1
 ?>
Index: /extensions/UserAdvManager/trunk/main.inc.php
===================================================================
--- /extensions/UserAdvManager/trunk/main.inc.php	(revision 12313)
+++ /extensions/UserAdvManager/trunk/main.inc.php	(revision 12314)
@@ -131,5 +131,5 @@
       {
         array_push($page['errors'], l10n('UAM_Guest cannot be pwdreset'));
-        $template->append('errors', l10n('UAM_Guest cannot be pwdreset'));
+        $errors = l10n('UAM_Guest cannot be pwdreset');
       }
       if (($conf['guest_id'] != $conf['default_user_id']) and
@@ -137,19 +137,63 @@
       {
         array_push($page['errors'], l10n('UAM_Default user cannot be pwgreset'));
-        $template->append('errors', l10n('UAM_Default user cannot be pwgreset'));
+        $errors = l10n('UAM_Default user cannot be pwgreset');
       }
       if (in_array($conf['webmaster_id'], $collection))
       {
         array_push($page['errors'], l10n('UAM_Webmaster cannot be pwdreset'));
-        $template->append('errors', l10n('UAM_Webmaster cannot be pwdreset'));
+        $errors = l10n('UAM_Webmaster cannot be pwdreset');
       }
       if (in_array($user['id'], $collection))
       {
         array_push($page['errors'], l10n('UAM_You cannot pwdreset your account'));
-        $template->append('errors', l10n('UAM_You cannot pwdreset your account'));
-      }
+        $errors = l10n('UAM_You cannot pwdreset your account');
+      }
+
+      // Generic accounts exclusion (including Adult_Content generic users)
+      // ------------------------------------------------------------------
+      $query ='
+SELECT u.id
+FROM '.USERS_TABLE.' AS u
+INNER JOIN '.USER_INFOS_TABLE.' AS ui
+  ON u.id = ui.user_id
+WHERE ui.status = "generic"
+;';
+
+	    $result = pwg_query($query);
+
+      while ($row = pwg_db_fetch_assoc($result))
+      {
+        if (in_array($row['id'], $collection))
+        {
+          array_push($page['errors'], l10n('UAM_Generic cannot be pwdreset'));
+          $errors = l10n('UAM_Generic cannot be pwdreset');
+        }
+      }
+
+      // Admins accounts exclusion
+      // --------------------------
+      $query ='
+SELECT u.id
+FROM '.USERS_TABLE.' AS u
+INNER JOIN '.USER_INFOS_TABLE.' AS ui
+  ON u.id = ui.user_id
+WHERE ui.status = "admin"
+;';
+
+	    $result = pwg_query($query);
+
+      while ($row = pwg_db_fetch_assoc($result))
+      {
+        if (in_array($row['id'], $collection))
+        {
+          array_push($page['errors'], l10n('UAM_Admins cannot be pwdreset'));
+          $errors = l10n('UAM_Admins cannot be pwdreset');
+        }
+      }
+
+      $template->append('errors', $errors);
 
       if (count($page['errors']) == 0)
-      {  
+      {
         if (isset($_POST['confirm_pwdreset']) and 1 == $_POST['confirm_pwdreset'])
         {
@@ -182,5 +226,19 @@
         }
       }
-    }  
+    }
+
+$page['order_by_items'] = array(
+  'id' => l10n('registration date'),
+  'username' => l10n('Username'),
+  'level' => l10n('Privacy level'),
+  'Language' => l10n('Language'),
+  'UAM_pwdreset' => l10n('UAM_PwdReset'),
+  );
+
+// Filter order options
+$template->assign('order_options', $page['order_by_items']);
+$template->assign('order_selected',
+    isset($_GET['order_by']) ? $_GET['order_by'] : '');
+
     $template->set_prefilter('user_list', 'UAM_PwdReset_Prefilter');
   }
