Index: extensions/NBC_UserAdvManager/trunk/changelog.txt.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/changelog.txt.php	(revision 6989)
+++ extensions/NBC_UserAdvManager/trunk/changelog.txt.php	(revision 6990)
@@ -196,4 +196,6 @@
             Bug 1821 fixed - Cleanup of old deprecated functions slags (Case sensitivity on logins)
             Bug 1834 fixed - Improving plugin installation and uninstallation process
+
+-- 2.15.7 : Bug 1869 fixed - Compatibility with Adult_Content installation process
 */
 ?>
Index: extensions/NBC_UserAdvManager/trunk/main.inc.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 6989)
+++ extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 6990)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: UserAdvManager
-Version: 2.15.6
+Version: 2.15.7b
 Description: Renforcer la gestion des utilisateurs - Enforce users management
 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
@@ -56,6 +56,6 @@
   $conf_UAM = unserialize($conf['UserAdvManager']);
 
-  /* Admins and Guests are not tracked for Ghost Tracker or Users Tracker */
-  if (!is_admin() and !is_a_guest())
+  /* Admins, Guests and Adult_Content users are not tracked for Ghost Tracker or Users Tracker */
+  if (!is_admin() and !is_a_guest() and $user['username'] != "16" and $user['username'] != "18")
   {
     if ((isset($conf_UAM[16]) and $conf_UAM[16] == 'true') or (isset($conf_UAM[19]) and $conf_UAM[19] == 'true'))
@@ -106,40 +106,44 @@
 
   $conf_UAM = unserialize($conf['UserAdvManager']);
-  
-  if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
-  {
-    /* This is to send an information email and set user to "waiting" group or status until admin validation */
-    $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
-    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
-    setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
-  }
-  elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'false') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
-  {
-    /* This is to set user to "wainting" group or status until admin validation */
-    setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
-  }
-  elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'false'))
-  {
-    /* This is to send an information email without validation key */
-    $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
-    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
-  }
-  /* Sending registration confirmation by email */
-  elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
-  {
-    if (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == '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[20]) and $conf_UAM[20] == 'false')
-    {
+
+  // Exclusion of Adult_Content users
+  if ($register_user['username'] != "16" and $register_user['username'] != "18")
+  {
+    if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local') and ($register_user['username'] != "16" and $register_user['username'] != "18"))
+    {
+      /* This is to send an information email and set user to "waiting" group or status until admin validation */
       $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
       SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
-    }
-    elseif (!is_admin())
-    {
+      setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
+    }
+    elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'false') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local') and ($register_user['username'] != "16" and $register_user['username'] != "18"))
+    {
+      /* This is to set user to "waiting" group or status until admin validation */
+      setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
+    }
+    elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'false') and ($register_user['username'] != "16" and $register_user['username'] != "18"))
+    {
+      /* This is to send an information email without validation key */
       $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
-      SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
+      SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
+    }
+    /* Sending registration confirmation by email */
+    elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true') and ($register_user['username'] != "16" and $register_user['username'] != "18"))
+    {
+      if (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == '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[20]) and $conf_UAM[20] == '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);
+      }
     }
   }
@@ -161,5 +165,5 @@
 
 
-/* Check users registration */
+// Check users registration
 add_event_handler('register_user_check', 'UAM_RegistrationCheck', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
 
@@ -168,124 +172,128 @@
   global $errors, $conf;
 
-/* *********************************************************** */
-/* We need to reset the standard Piwigo's register controls    */
-/* because the call of register_user_check trigger resets them */
-/* *********************************************************** */
-  /* ********************************** */
-  /* Standard Piwigo's username control */
-  /* ********************************** */
-  if ($_POST['login'] == '')
-  {
-    return l10n('reg_err_login1');
-  }
-  if (preg_match('/^.* $/', $_POST['login']))
-  {
-    return l10n('reg_err_login2');
-  }
-  if (preg_match('/^ .*$/', $_POST['login']))
-  {
-    return l10n('reg_err_login3');
-  }
-  if (get_userid($_POST['login']))
-  {
-    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 */
-  {
-  /* Email doblons 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');
-    }
+  // Exclusion of Adult_Content users
+  if ($user['username'] != "16" and $user['username'] != "18")
+  {
+// ***********************************************************
+// We need to reset the standard Piwigo's register controls   
+// because the call of register_user_check trigger resets them
+// ***********************************************************
+  // **********************************
+  // Standard Piwigo's username control
+  // **********************************
+    if ($_POST['login'] == '')
+    {
+      return l10n('reg_err_login1');
+    }
+    if (preg_match('/^.* $/', $_POST['login']))
+    {
+      return l10n('reg_err_login2');
+    }
+    if (preg_match('/^ .*$/', $_POST['login']))
+    {
+      return l10n('reg_err_login3');
+    }
+    if (get_userid($_POST['login']))
+    {
+      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
+    {
+    // Email doblons 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');
+      }
     
-    $query = '
+      $query = '
 SELECT count(*)
 FROM '.USERS_TABLE.'
 WHERE upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['email'].'\')
 ;';
-    list($count) = pwg_db_fetch_row(pwg_query($query));
-    if ($count != 0)
-    {
-      return l10n('reg_err_mail_address_dbl');
-    }
-  }
-
-  if (script_basename() == 'register') /* not the same email variable if we are on users registration page or on admin's user registration page*/
-  {
-  /* Email doblons 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['mail_address']))
-    {
-      return l10n('reg_err_mail_address');
-    }
+      list($count) = pwg_db_fetch_row(pwg_query($query));
+      if ($count != 0)
+      {
+        return l10n('reg_err_mail_address_dbl');
+      }
+    }
+
+    if (script_basename() == 'register') // not the same email variable if we are on users registration page or on admin's user registration page
+    {
+  // Email doblons 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['mail_address']))
+      {
+        return l10n('reg_err_mail_address');
+      }
     
-    $query = '
+      $query = '
 SELECT count(*)
 FROM '.USERS_TABLE.'
 WHERE upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['mail_address'].'\')
 ;';
-    list($count) = pwg_db_fetch_row(pwg_query($query));
-    if ($count != 0)
-    {
-      return l10n('reg_err_mail_address_dbl');
-    }
-  }
-/* ****************************************** */
-/* End of Piwigo's standard register controls */
-/* ****************************************** */
-
-
-/* ****************************************** */
-/* Here begins the advanced register controls */
-/* ****************************************** */
-  $PasswordCheck = 0;
-
-  $conf_UAM = unserialize($conf['UserAdvManager']);
-
-  /* Password enforcement control */
-  if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14]))
-  {
-    if (!empty($user['password']) and !is_admin())
-    {
-      $PasswordCheck = testpassword($user['password']);
-  
-      if ($PasswordCheck < $conf_UAM[14])
-      {
-        $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
-        return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
-      }
-    }
-    else if (!empty($user['password']) and is_admin() and isset($conf_UAM[15]) and $conf_UAM[15] == 'true')
-    { 
-      $PasswordCheck = testpassword($user['password']);
-  
-      if ($PasswordCheck < $conf_UAM[14])
-      {
-        $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
-        return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
-      }
-    }
-  }
-
-  /* Username without forbidden keys */
-  if (isset($conf_UAM[6]) and $conf_UAM[6] == 'true' and !empty($_POST['login']) and ValidateUsername($_POST['login']) and !is_admin())
-  {
-    $_POST['login'] = '';
-    return($lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_UAM[7]."'");
-  }
-
-  /* Email without forbidden domains */
-  if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']) and !is_admin())
-  {
-    $_POST['mail_address'] = '';
-    return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_UAM[12]."'");
+      list($count) = pwg_db_fetch_row(pwg_query($query));
+      if ($count != 0)
+      {
+        return l10n('reg_err_mail_address_dbl');
+      }
+    }
+// ******************************************
+// End of Piwigo's standard register controls
+// ******************************************
+
+
+// ******************************************
+// Here begins the advanced register controls
+// ******************************************
+    $PasswordCheck = 0;
+
+    $conf_UAM = unserialize($conf['UserAdvManager']);
+
+    // Password enforcement control
+    if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14]))
+    {
+      if (!empty($user['password']) and !is_admin())
+      {
+        $PasswordCheck = testpassword($user['password']);
+  
+        if ($PasswordCheck < $conf_UAM[14])
+        {
+          $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
+          return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
+        }
+      }
+      else if (!empty($user['password']) and is_admin() and isset($conf_UAM[15]) and $conf_UAM[15] == 'true')
+      {
+        $PasswordCheck = testpassword($user['password']);
+  
+        if ($PasswordCheck < $conf_UAM[14])
+        {
+          $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
+          return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
+        }
+      }
+    }
+
+    // Username without forbidden keys
+    if (isset($conf_UAM[6]) and $conf_UAM[6] == 'true' and !empty($_POST['login']) and ValidateUsername($_POST['login']) and !is_admin())
+    {
+      $_POST['login'] = '';
+      return($lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_UAM[7]."'");
+    }
+
+    // Email without forbidden domains
+    if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']) and !is_admin())
+    {
+      $_POST['mail_address'] = '';
+      return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_UAM[12]."'");
+    }
   }
 }
@@ -301,5 +309,5 @@
 
     $conf_UAM = unserialize($conf['UserAdvManager']);
-
+    
     if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true'))
     {
