Index: /extensions/UserAdvManager/branches/2.20/admin/UAM_admin.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/admin/UAM_admin.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/admin/UAM_admin.php	(revision 10958)
@@ -106,5 +106,5 @@
   case 'global':
 
-	if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) 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']) and isset($_POST['UAM_RedirToProfile']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']))
+	if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) 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']) and isset($_POST['UAM_RedirToProfile']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']) and isset($_POST['UAM_GroupComm']))
   {
 
@@ -179,5 +179,7 @@
       $_POST['UAM_USRAutoMail'],
       $_POST['UAM_Stuffs'],
-      $_POST['UAM_HidePassw']
+      $_POST['UAM_HidePassw'],
+      $_POST['UAM_GroupComm'],
+      (isset($_POST['UAM_AllowComm_Group'])?$_POST['UAM_AllowComm_Group']:''),
       );
 
@@ -257,4 +259,5 @@
   $Valid = -1;
   $Downgrade = -1;
+  $AllowComm = -1;
 	
   //Check groups list in database 
@@ -284,4 +287,9 @@
 		{
 	  	$Downgrade = $row['id'];
+		}
+    //configuration value for users group allowed to post comments
+    if (isset($conf_UAM[37]) and $conf_UAM[37] == $row['id'])
+		{
+	  	$AllowComm = $row['id'];
 		}
   }
@@ -309,4 +317,12 @@
       'group_options'=> $groups,
       'group_selected' => $Downgrade
+			)
+  	);
+  //Template initialization for allowed group for comments
+  $template->assign(
+    'AllowComm_Group',
+		array(
+      'group_options'=> $groups,
+      'group_selected' => $AllowComm
 			)
   	);
@@ -449,4 +465,7 @@
     'UAM_HIDEPASSW_TRUE'             => $conf_UAM[35]=='true' ?  'checked="checked"' : '' ,
     'UAM_HIDEPASSW_FALSE'            => $conf_UAM[35]=='false' ?  'checked="checked"' : '' ,
+    'UAM_GROUPCOMM_TRUE'             => $conf_UAM[36]=='true' ?  'checked="checked"' : '' ,
+    'UAM_GROUPCOMM_FALSE'            => $conf_UAM[36]=='false' ?  'checked="checked"' : '' ,
+    'UAM_ALLOWCOMM_GROUP'            => $conf_UAM[37],
 		'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score,
     'UAM_ERROR_REPORTS4'             => $UAM_Exclusionlist_Error,
Index: /extensions/UserAdvManager/branches/2.20/admin/template/global.tpl
===================================================================
--- /extensions/UserAdvManager/branches/2.20/admin/template/global.tpl	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/admin/template/global.tpl	(revision 10958)
@@ -679,4 +679,29 @@
 
             <li>
+              <label class="cluetip" title="{'UAM_GroupCommTitle'|translate}|{'UAM_GroupCommTitle_d'|translate}">
+                {'UAM_Group_Comments'|@translate}
+              </label>
+            <br><br>
+              <input type="radio" value="false" {$UAM_GROUPCOMM_FALSE} name="UAM_GroupComm">
+                {'UAM_Disable'|@translate}
+            <br>
+              <input type="radio" value="true" {$UAM_GROUPCOMM_TRUE} name="UAM_GroupComm">
+                {'UAM_Enable'|@translate}
+            <br><br>
+              <ul>
+                <li>
+                  <label>
+                    {'UAM_AllowedComm_Group'|@translate}
+                  </label>
+                <br><br>
+                  <div id="uam_leftmargin">
+                    {html_options name="UAM_AllowComm_Group" options=$AllowComm_Group.group_options selected=$AllowComm_Group.group_selected}
+                  </div>
+                </li>
+              </ul>
+            <br><br>
+            </li>
+
+            <li>
               <label class="cluetip" title="{'UAM_RedirTitle'|translate}|{'UAM_RedirTitle_d'|translate}">
                 {'UAM_RedirToProfile'|@translate}
Index: /extensions/UserAdvManager/branches/2.20/changelog.txt.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/changelog.txt.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/changelog.txt.php	(revision 10958)
@@ -250,4 +250,6 @@
 
 -- 2.20.7 : Use pwg_db_real_escape_string() instead of addslashes()
+            Database upgrade process simplied (using version_compare() and code refactoring)
+            Bug 2253 fixed - New feature to allow comments on pictures only for specific users (who belong to a group) when "comments for all" is set
 */
 ?>
Index: /extensions/UserAdvManager/branches/2.20/include/functions.inc.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/include/functions.inc.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/include/functions.inc.php	(revision 10958)
@@ -752,5 +752,7 @@
  * Triggered on user_comment_check
  * 
- * checks if author is mandatory and set on comments post
+ * checks if author is mandatory and set on comments post when comments for all is set
+ * 
+ * cheks if author is in an allowed group to post comment when comments for all is not set
  *
  * @param : comment action, comment
@@ -762,14 +764,26 @@
 {
   load_language('plugin.lang', UAM_PATH);
-  global $infos, $conf, $template;
+  global $infos, $conf, $user;
 
   $conf_UAM = unserialize($conf['UserAdvManager']);
 
-// User creation OR update
-  if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and $conf['comments_forall'] == 'true' and $comm['author'] == 'guest')
+// Does not allow empty author name on comments for all
+  if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and $comm['author'] == 'guest' and $conf['comments_forall'])
   {
     $comment_action = 'reject';
 
     array_push($infos, l10n('UAM_Empty Author'));
+  }
+
+
+// Do not allow comments if user is not in an allowed group
+  if (isset($conf_UAM[36]) and $conf_UAM[36] == 'true' and !$conf['comments_forall'])
+  {
+    if (!UAM_CheckAuthor($comm['author']))
+    {
+      $comment_action = 'reject';
+
+      array_push($infos, l10n('UAM_Not_Allowed_Author'));
+    }
   }
 
@@ -2526,4 +2540,46 @@
 
 /**
+ * Called from UAM_CheckEmptyCommentAuthor()
+ * Checks if comment's author name is in the allowed group
+ * 
+ * @author   : author's name
+ * 
+ * @returns  : Boolean (true is user is allowed to post / false if not allowed)
+ * 
+ */
+function UAM_CheckAuthor($author)
+{
+  global $conf;
+  
+	// Get UAM configuration
+  $conf_UAM = unserialize($conf['UserAdvManager']);
+  
+  if (isset($conf_UAM[37]) and $conf_UAM[37] <> -1)
+  {
+    $query = '
+SELECT u.id,
+       u.username,
+       ug.user_id,
+       ug.group_id
+FROM '.USERS_TABLE.' AS u
+  INNER JOIN '.USER_GROUP_TABLE.' AS ug
+    ON u.id = ug.user_id
+WHERE u.username LIKE "'.$author.'"
+  AND ug.group_id = '.$conf_UAM[37].'
+;';
+
+    $count = pwg_db_num_rows(pwg_query($query));
+
+    if (is_null($count) or $count == 0)
+    {
+      return false;
+    }
+    else
+      return true;
+  }
+}
+
+
+/**
  * Useful for debugging - 4 vars can be set
  * Output result to log.txt file
Index: /extensions/UserAdvManager/branches/2.20/include/upgradedb.inc.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/include/upgradedb.inc.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/include/upgradedb.inc.php	(revision 10958)
@@ -453,3 +453,36 @@
 	pwg_query($query);
 }
+
+/* upgrade from 2.20.4 to 2.20.7 */
+/* ***************************** */
+function upgrade_2204_2207()
+{
+  global $conf;
+
+  // Upgrading options
+  $query = '
+SELECT value
+  FROM '.CONFIG_TABLE.'
+WHERE param = "UserAdvManager"
+;';
+
+  $result = pwg_query($query);
+  $conf_UAM = pwg_db_fetch_assoc($result);
+    
+  $Newconf_UAM = unserialize($conf_UAM['value']);
+  
+  $Newconf_UAM[36] = 'false';
+  $Newconf_UAM[37] = '-1';
+  
+  $update_conf = serialize($Newconf_UAM);
+    
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.pwg_db_real_escape_string($update_conf).'"
+WHERE param="UserAdvManager"
+LIMIT 1
+;';
+
+	pwg_query($query);
+}
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/de_DE/help/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/de_DE/help/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/de_DE/help/plugin.lang.php	(revision 10958)
@@ -285,3 +285,11 @@
 /*TODO*/$lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+$lang['UAM_GroupCommTitle'] = 'Kommentare zulassen, um eine Gruppe von Benutzern';
+/*TODO*/$lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all.
+<br><br>
+By default, when &quot;comments for all&quot; option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/de_DE/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/de_DE/plugin.lang.php	(revision 10958)
@@ -330,3 +330,10 @@
 $lang['UAM_HidePassw'] = 'Passwort im Klartext in der Informations-E-Mail';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+$lang['UAM_Group_Comments'] = 'Kommentare zulassen um eine Gruppe von Benutzern';
+$lang['UAM_AllowedComm_Group'] = 'Wählen Sie die Gruppe von Benutzern gestattet Kommentare anzulegen:';
+$lang['UAM_Not_Allowed_Author'] = 'Entschuldigung, Sie sind nicht befugt einen Kommentar abzugeben. Bitte kontaktieren Sie den Administrator der Website.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/en_UK/help/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/en_UK/help/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/en_UK/help/plugin.lang.php	(revision 10958)
@@ -285,3 +285,11 @@
 $lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+$lang['UAM_GroupCommTitle'] = 'Allow comments to a group of users';
+$lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all.
+<br><br>
+By default, when &quot;comments for all&quot; option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/en_UK/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/en_UK/plugin.lang.php	(revision 10958)
@@ -332,3 +332,10 @@
 $lang['UAM_HidePassw'] = 'Password in clear text in the information email';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+$lang['UAM_Group_Comments'] = 'Allow comments to a group of users';
+$lang['UAM_AllowedComm_Group'] = 'Select the group of users allowed to post comments:';
+$lang['UAM_Not_Allowed_Author'] = 'Sorry, you are not authorized to post a comment. Please contact the site administrator.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/es_ES/help/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/es_ES/help/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/es_ES/help/plugin.lang.php	(revision 10958)
@@ -281,3 +281,11 @@
 /*TODO*/$lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+/*TODO*/$lang['UAM_GroupCommTitle'] = 'Allow comments to a group of users';
+/*TODO*/$lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all.
+<br><br>
+By default, when &quot;comments for all&quot; option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/es_ES/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/es_ES/plugin.lang.php	(revision 10958)
@@ -370,3 +370,10 @@
 $lang['UAM_HidePassw'] = 'Contraseña en texto claro en la información del correo electrónico';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+/*TODO*/$lang['UAM_Group_Comments'] = 'Allow comments to a group of users';
+/*TODO*/$lang['UAM_AllowedComm_Group'] = 'Select the group of users allowed to post comments:';
+/*TODO*/$lang['UAM_Not_Allowed_Author'] = 'Sorry, you are not authorized to post a comment. Please contact the site administrator.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/fr_FR/help/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/fr_FR/help/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/fr_FR/help/plugin.lang.php	(revision 10958)
@@ -281,3 +281,11 @@
 $lang['UAM_HidePasswTitle_d'] = 'Choisissez ici si vous souhaitez faire afficher le mot de passe choisi par le visiteur dans le mail d\'information. Si vous activez l\'option, le mot de passe apparaitra alors en clair. Si vous la désactivez, le mot de passe n\'apparaitra pas du tout.';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+$lang['UAM_GroupCommTitle'] = 'Autoriser les commentaires pour un groupe d\'utilisateurs';
+$lang['UAM_GroupCommTitle_d'] = 'Cette option permet de spécifier un groupe d\'utilisateurs qui seront autorisés à poster des commentaires lorsque la galerie est configurée pour ne pas autoriser les commentaires pour tous.
+<br><br>
+Par défaut, lorsque les &quot;commentaires pour tous&quot; sont désactivés, seuls les utilisateurs inscrits peuvent poster des commentaires. Avec cette option, vous pouvez restreindre d\'avantage ce fonctionnement en précisant un groupe d\'utilisateurs. Ainsi, seuls les utilisateurs inscrits et faisant partie de ce groupe pourront poster des commentaires.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/fr_FR/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/fr_FR/plugin.lang.php	(revision 10958)
@@ -331,3 +331,10 @@
 $lang['UAM_HidePassw'] = 'Mot de passe en clair dans le mail d\'information';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+$lang['UAM_Group_Comments'] = 'Autoriser les commentaires pour un groupe d\'utilisateurs';
+$lang['UAM_AllowedComm_Group'] = 'Sélectionnez le groupe d\'utilisateurs autorisé à poster des commentaires :';
+$lang['UAM_Not_Allowed_Author'] = 'Désolé, vous n\'êtes pas autorisé à poster un commentaire. Veuillez contacter l\'administrateur du site.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/it_IT/help/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/it_IT/help/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/it_IT/help/plugin.lang.php	(revision 10958)
@@ -272,3 +272,11 @@
 /*TODO*/$lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+/*TODO*/$lang['UAM_GroupCommTitle'] = 'Allow comments to a group of users';
+/*TODO*/$lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all.
+<br><br>
+By default, when &quot;comments for all&quot; option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/it_IT/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/it_IT/plugin.lang.php	(revision 10958)
@@ -329,3 +329,10 @@
 $lang['UAM_HidePassw'] = 'Password in chiaro nelle informazioni e-mail';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+/*TODO*/$lang['UAM_Group_Comments'] = 'Allow comments to a group of users';
+/*TODO*/$lang['UAM_AllowedComm_Group'] = 'Select the group of users allowed to post comments:';
+/*TODO*/$lang['UAM_Not_Allowed_Author'] = 'Sorry, you are not authorized to post a comment. Please contact the site administrator.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/lv_LV/help/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/lv_LV/help/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/lv_LV/help/plugin.lang.php	(revision 10958)
@@ -307,3 +307,11 @@
 /*TODO*/$lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+/*TODO*/$lang['UAM_GroupCommTitle'] = 'Allow comments to a group of users';
+/*TODO*/$lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all.
+<br><br>
+By default, when &quot;comments for all&quot; option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/language/lv_LV/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/language/lv_LV/plugin.lang.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/language/lv_LV/plugin.lang.php	(revision 10958)
@@ -367,3 +367,10 @@
 /*TODO*/$lang['UAM_HidePassw'] = 'Clear password in information email';
 // --------- End: New or revised $lang ---- from version 2.20.4
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.20.7
+/*TODO*/$lang['UAM_Group_Comments'] = 'Allow comments to a group of users';
+/*TODO*/$lang['UAM_AllowedComm_Group'] = 'Select the group of users allowed to post comments:';
+/*TODO*/$lang['UAM_Not_Allowed_Author'] = 'Sorry, you are not authorized to post a comment. Please contact the site administrator.';
+// --------- End: New or revised $lang ---- from version 2.20.7
 ?>
Index: /extensions/UserAdvManager/branches/2.20/maintain.inc.php
===================================================================
--- /extensions/UserAdvManager/branches/2.20/maintain.inc.php	(revision 10957)
+++ /extensions/UserAdvManager/branches/2.20/maintain.inc.php	(revision 10958)
@@ -236,20 +236,27 @@
   }
 
-/* Check for upgrade from 2.16 to 2.20 */
-/* *********************************** */
-  if (isset($conf['UserAdvManager_Version']) and strcmp($conf['UserAdvManager_Version'], '2.20.0') < 0)
-  {
+/* Check database upgrade since version 2.16.0 */
+  if (isset($conf['UserAdvManager_Version']))
+  {
+    if (version_compare($conf['UserAdvManager_Version'], '2.20.0') < 0)
+    {
     /* upgrade from branch 2.16 to 2.20 */
     /* ******************************** */
-    upgrade_216_220();
-  }
-
-/* Check for upgrade from 2.20.3 to 2.20.4 */
-/* *************************************** */
-  if (isset($conf['UserAdvManager_Version']) and strcmp($conf['UserAdvManager_Version'], '2.20.4') < 0)
-  {
-    /* upgrade from branch 2.16 to 2.20 */
-    /* ******************************** */
-    upgrade_2203_2204();
+      upgrade_216_220();
+    }
+    
+    if (version_compare($conf['UserAdvManager_Version'], '2.20.4') < 0)
+    {
+    /* upgrade from version 2.20.3 to 2.20.4 */
+    /* ************************************* */
+      upgrade_2203_2204();
+    }
+    
+    if (version_compare($conf['UserAdvManager_Version'], '2.20.7') < 0)
+    {
+    /* upgrade from version 2.20.4 to 2.20.7 */
+    /* ************************************* */
+      upgrade_2204_2207();
+    }
   }
 
