Index: extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php	(revision 9177)
+++ extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php	(revision 9253)
@@ -105,5 +105,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_CustomPasswRetr']))
+	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']))
   {
 
@@ -551,9 +551,10 @@
 		}
 
-    // Avoid jquery accordeon menu bug when there is no users to display
-    if (empty($visible_user_list))
+    // Avoid jquery accordion menu bug when there is no users to display
+    // Pending because it causes php warnings when no users are listed (when $visible_user_list[] is empty)
+    /*if (empty($visible_user_list))
     {
       $visible_user_list[] = null;
-    }
+    }*/
 
 		foreach ($visible_user_list as $local_user)
@@ -1029,8 +1030,9 @@
 
     // Avoid jquery accordeon menu bug when there is no users to display
-    if (empty($visible_user_list))
+    // Pending because it causes php warnings when no users are listed (when $visible_user_list[] is empty)
+    /*if (empty($visible_user_list))
     {
       $visible_user_list[] = null;
-    }
+    }*/
 
 		foreach ($visible_user_list as $local_user)
@@ -1353,18 +1355,15 @@
 		}
     
-    if (isset($_POST['GhostTracker_Init']))
-    {
-      //Reset is only allowed for admins !
-      if (is_admin())
-      {
-        $query1 = '
+    if (isset($_POST['GhostTracker_Init']) and is_admin()) //Reset is only allowed for admins !
+    {
+      $query1 = '
 SELECT *
   FROM '.USER_LASTVISIT_TABLE.';';
 
-        $count = pwg_db_num_rows(pwg_query($query1));
-
-        if ($count <> 0)
-        {
-          $query = '
+      $count = pwg_db_num_rows(pwg_query($query1));
+
+      if ($count <> 0)
+      {
+        $query = '
 SELECT DISTINCT u.id,
                 ui.status AS status
@@ -1379,20 +1378,20 @@
 ;';
 
-          $result = pwg_query($query);
+        $result = pwg_query($query);
           
-          while ($row = pwg_db_fetch_assoc($result))
-          {
-            list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
+        while ($row = pwg_db_fetch_assoc($result))
+        {
+          list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
             
-            $query = "
+          $query = "
 INSERT INTO ".USER_LASTVISIT_TABLE." (user_id, lastvisit, reminder)
 VALUES ('".$row['id']."','".$dbnow."','false')
 ;";
-            pwg_query($query);
-          }
+          pwg_query($query);
         }
-        else if ($count == 0)
-        {
-          $query = '
+      }
+      else if ($count == 0)
+      {
+        $query = '
 SELECT DISTINCT u.id,
                 ui.status AS status
@@ -1406,20 +1405,19 @@
 ;';
 
-          $result = pwg_query($query);
+        $result = pwg_query($query);
           
-          while($row = pwg_db_fetch_assoc($result))
-          {
-            list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
+        while($row = pwg_db_fetch_assoc($result))
+        {
+          list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
             
-            $query = "
+          $query = "
 INSERT INTO ".USER_LASTVISIT_TABLE." (user_id, lastvisit, reminder)
 VALUES ('".$row['id']."','".$dbnow."','false')
 ;";
-            pwg_query($query);
-          }
+          pwg_query($query);
         }
+      }
         
-        array_push($page['infos'], l10n('UAM_GhostTracker_Init_OK'));
-      }
+      array_push($page['infos'], l10n('UAM_GhostTracker_Init_OK'));
     }
 
