Index: extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 4340)
+++ extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 4380)
@@ -17,4 +17,17 @@
 
 load_language('plugin.lang', NBC_UserAdvManager_PATH);
+
+$page['global'] = array();
+$error = array();
+$UserAdvManager_Password_Test_Score = 0;
+$pattern = '/;/';
+$replacement = '.';
+
+$UserAdvManager_MailInfo_Error_Txt = false;
+$UserAdvManager_ConfirmMail_Error_Txt = false;
+$UserAdvManager_Reminder_Error_Txt = false;
+$UserAdvManager_ConfirmMail_Error_Txt1 = false;
+$UserAdvManager_ConfirmMail_Error_Txt2 = false;
+$UserAdvManager_Exclusionlist_Error = false;
 
 // +-----------------------------------------------------------------------+
@@ -25,4 +38,6 @@
 else
   $page['tab'] = $_GET['tab'];
+
+//$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
 
 $tabsheet = new tabsheet();
@@ -33,4 +48,10 @@
                l10n('Tab_ConfirmMail'),
                $my_base_url.'&amp;tab=confirmmail');
+//if (isset($conf_nbc_UserAdvManager[20]) and $conf_nbc_UserAdvManager[20]=='true')
+//{
+  $tabsheet->add('userlist',
+                 l10n('Tab_UserList'),
+                 $my_base_url.'&amp;tab=userlist');
+//}
 $tabsheet->add('usermanager',
                l10n('Tab_UserManager'),
@@ -41,17 +62,4 @@
 $tabsheet->select($page['tab']);
 $tabsheet->assign();
-
-$page['global'] = array();
-$error = array();
-$UserAdvManager_Password_Test_Score = 0;
-$pattern = '/;/';
-$replacement = '.';
-
-$UserAdvManager_MailInfo_Error_Txt = false;
-$UserAdvManager_ConfirmMail_Error_Txt = false;
-$UserAdvManager_Reminder_Error_Txt = false;
-$UserAdvManager_ConfirmMail_Error_Txt1 = false;
-$UserAdvManager_ConfirmMail_Error_Txt2 = false;
-$UserAdvManager_Exclusionlist_Error = false;
 
 // +-----------------------------------------------------------------------+
@@ -108,5 +116,5 @@
     }
 		
-		$newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'].';'.$_POST['UserAdvManager_AdminPassword_Enforced'].';'.$_POST['UserAdvManager_GhostUser_Tracker'].';'.$_POST['UserAdvManager_GhostTracker_DayLimit'].';'.$_POST['UserAdvManager_GhostTracker_ReminderText'];
+		$newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'].';'.$_POST['UserAdvManager_AdminPassword_Enforced'].';'.$_POST['UserAdvManager_GhostUser_Tracker'].';'.$_POST['UserAdvManager_GhostTracker_DayLimit'].';'.$_POST['UserAdvManager_GhostTracker_ReminderText'].';'.$_POST['UserAdvManager_Add_LastVisit_Column'];
 		
 		$conf['nbc_UserAdvManager'] = $newconf_nbc_UserAdvManager;
@@ -124,4 +132,5 @@
   }
 
+/* Testing password enforcement */
   if (isset($_POST['PasswordTest']) and !is_adviser() and isset($_POST['UserAdvManager_Password_Test']) and !empty($_POST['UserAdvManager_Password_Test']))
   {
@@ -255,4 +264,6 @@
     'UserAdvManager_GHOSTRACKER_DAYLIMIT'     => $conf_nbc_UserAdvManager[18],
     'UserAdvManager_GHOSTRACKER_REMINDERTEXT' => $conf_nbc_UserAdvManager[19],
+    'UserAdvManager_ADDLASTVISIT_TRUE'        => $conf_nbc_UserAdvManager[20]=='true' ?  'checked="checked"' : '' ,
+    'UserAdvManager_ADDLASTVISIT_FALSE'       => $conf_nbc_UserAdvManager[20]=='false' ?  'checked="checked"' : '' ,
 		'UserAdvManager_PASSWORD_TEST_SCORE'      => $UserAdvManager_Password_Test_Score,
     'UserAdvManager_ERROR_REPORTS1'           => $UserAdvManager_MailInfo_Error_Txt,
@@ -468,4 +479,156 @@
 // *************************************************************************
 // +-----------------------------------------------------------------------+
+// |                           Users list page                             |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'userlist':
+  
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  
+  if (isset($conf_nbc_UserAdvManager[20]) and $conf_nbc_UserAdvManager[20]=='true')
+  {
+// +-----------------------------------------------------------------------+
+// |                           initialization                              |
+// +-----------------------------------------------------------------------+
+
+		if (!defined('PHPWG_ROOT_PATH'))
+    {
+    	die('Hacking attempt!');
+    }
+          
+    include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+		check_status(ACCESS_ADMINISTRATOR);
+
+// +-----------------------------------------------------------------------+
+// |                               user list                               |
+// +-----------------------------------------------------------------------+
+
+		$page['filtered_users'] = get_user_list();
+
+// +-----------------------------------------------------------------------+
+// |                           Template Init                               |
+// +-----------------------------------------------------------------------+
+		$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
+
+    if (isset($_GET['start']) and is_numeric($_GET['start']))
+    {
+      $start = $_GET['start'];
+    }
+    else
+    {
+      $start = 0;
+    }
+
+// +-----------------------------------------------------------------------+
+// |                            navigation bar                             |
+// +-----------------------------------------------------------------------+
+
+$url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
+
+$navbar = create_navigation_bar(
+  $url,
+  count($page['filtered_users']),
+  $start,
+  $conf['users_page']
+  );
+
+$template->assign('NAVBAR', $navbar);
+
+// +-----------------------------------------------------------------------+
+// |                               user list                               |
+// +-----------------------------------------------------------------------+
+
+    $visible_user_list = array();
+    foreach ($page['filtered_users'] as $num => $local_user)
+    {
+/* simulate LIMIT $start, $conf['users_page'] */
+			if ($num < $start)
+      {
+        continue;
+      }
+      if ($num >= $start + $conf['users_page'])
+      {
+        break;
+      }
+
+      $visible_user_list[] = $local_user;
+		}
+
+		foreach ($visible_user_list as $local_user)
+    {
+      // dates formating and compare
+      $today = date("d-m-Y"); // Get today's date
+      list($day, $month, $year) = explode('-', $today); // explode date of today						 
+      $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp
+	  	
+      list($regdate, $regtime) = explode(' ', $local_user['lastvisit']); // Explode date and time from registration date
+      list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date
+      $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp
+			
+      $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps	
+      $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days
+      
+      if (isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[17]=='true' and $conf_nbc_UserAdvManager[18] <> '')
+      {
+        if ((($deltadays*100)/$conf_nbc_UserAdvManager[18]) <= ((50*$conf_nbc_UserAdvManager[18])/100))
+        {
+          $display = 'green';
+        }
+        
+        if ((($deltadays*100)/$conf_nbc_UserAdvManager[18]) > ((50*$conf_nbc_UserAdvManager[18])/100) and (($deltadays*100)/$conf_nbc_UserAdvManager[18]) < ((100*$conf_nbc_UserAdvManager[18])/100))
+        {
+          $display = 'orange';
+        }
+        
+        if ((($deltadays*100)/$conf_nbc_UserAdvManager[18]) >= ((100*$conf_nbc_UserAdvManager[18])/100))
+        {
+          $display = 'red';
+        }
+        
+      }
+
+   		$template->append(
+     		'users',
+       	array(
+       		'ID'         => $local_user['id'],
+         	'USERNAME'   => stripslashes($local_user['username']),
+					'EMAIL'      => get_email_address_as_display_text($local_user['email']),
+          'LASTVISIT'  => $local_user['lastvisit'],
+          'DAYS'       => $deltadays,
+          'DISPLAY'    => $display,
+				)
+			);
+		}
+// +-----------------------------------------------------------------------+
+// |                             errors display                            |
+// +-----------------------------------------------------------------------+
+		if ( isset ($errors) and count($errors) != 0)
+		{
+	  	$template->assign('errors',array());
+			foreach ($errors as $error)
+	  	{
+				array_push($page['errors'], $error);
+	  	}
+ 		}  
+
+// +-----------------------------------------------------------------------+
+// |                           templates display                           |
+// +-----------------------------------------------------------------------+
+		$template->set_filename('plugin_admin_content', dirname(__FILE__) . '/userlist.tpl');
+    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');		
+  }
+  else
+  {
+		array_push($page['infos'], l10n('Err_Userlist_Settings'));
+  }
+  break;
+
+
+// *************************************************************************
+// +-----------------------------------------------------------------------+
 // |                           Users manager page                          |
 // +-----------------------------------------------------------------------+
@@ -493,11 +656,4 @@
 // +-----------------------------------------------------------------------+
 		check_status(ACCESS_ADMINISTRATOR);
-
-    $page['order_by_items'] = array(
-      'id' => l10n('registration_date'),
-      'username' => l10n('Username'),
-      'level' => l10n('Privacy level'),
-      'language' => l10n('language'),
-    );
 
 // +-----------------------------------------------------------------------+
@@ -751,5 +907,5 @@
         	)
       	);
-      	
+        
 				$page['filtered_users'] = get_unvalid_user_list();
 			}
@@ -874,12 +1030,4 @@
     }
 
-    $template->assign(
-      array(
-        'F_ADD_ACTION' => $base_url,
-        'F_USERNAME' => @htmlentities($_GET['username']),
-        'F_FILTER_ACTION' => get_root_url().'admin.php'
-        )
-   	  );
-
 /* Hide radio-button if not allow to assign adviser */
 		if ($conf['allow_adviser'])
@@ -887,5 +1035,20 @@
       	$template->assign('adviser', true);
     	}
-	
+
+// +-----------------------------------------------------------------------+
+// |                            navigation bar                             |
+// +-----------------------------------------------------------------------+
+
+$url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
+
+$navbar = create_navigation_bar(
+  $url,
+  count($page['filtered_users']),
+  $start,
+  $conf['users_page']
+  );
+
+$template->assign('NAVBAR', $navbar);
+
 // +-----------------------------------------------------------------------+
 // |                               user list                               |
@@ -922,4 +1085,23 @@
 			);
 
+      $query = '
+SELECT user_id, reminder
+FROM '.USER_CONFIRM_MAIL_TABLE.'
+WHERE user_id = '.$local_user['id'].'
+;';
+      $result = pwg_query($query);
+      
+      $row = mysql_fetch_assoc($result);
+    
+      if (isset($row['reminder']) and $row['reminder'] == 'true')
+      {
+        $reminder = l10n('Reminder_Sent_OK');
+      }
+      else if ((isset($row['reminder']) and $row['reminder'] == 'false') or !isset($row['reminder']))
+      {
+        $reminder = l10n('Reminder_Sent_NOK');
+      }
+
+
 	  	if (isset($_POST['pref_submit'])
     		and isset($_POST['selection'])
@@ -947,20 +1129,21 @@
      		'users',
        	array(
-       		'ID' => $local_user['id'],
-         	'CHECKED' => $checked,
-         	'U_PROFILE' => $profile_url.$local_user['id'],
-         	'U_PERM' => $perm_url.$local_user['id'],
-         	'USERNAME' => stripslashes($local_user['username'])
-						.($local_user['id'] == $conf['guest_id']
-						? '<BR />['.l10n('is_the_guest').']' : '')
-           	.($local_user['id'] == $conf['default_user_id']
-           	? '<BR />['.l10n('is_the_default').']' : ''),
-					'STATUS' => l10n('user_status_'.
-						$local_user['status']).(($local_user['adviser'] == 'true')
-           	? '<BR />['.l10n('adviser').']' : ''),
-					'EMAIL' => get_email_address_as_display_text($local_user['email']),
-         	'GROUPS' => $groups_string,
-         	'REGISTRATION' => $local_user['registration_date'],
-         	'EXPIRATION' => $expiration,
+       		'ID'               => $local_user['id'],
+         	'CHECKED'          => $checked,
+         	'U_PROFILE'        => $profile_url.$local_user['id'],
+         	'U_PERM'           => $perm_url.$local_user['id'],
+         	'USERNAME'         => stripslashes($local_user['username'])
+                                  .($local_user['id'] == $conf['guest_id']
+                                  ? '<BR>['.l10n('is_the_guest').']' : '')
+                                  .($local_user['id'] == $conf['default_user_id']
+                                  ? '<BR>['.l10n('is_the_default').']' : ''),
+                                  'STATUS' => l10n('user_status_'
+                                  .$local_user['status']).(($local_user['adviser'] == 'true')
+                                  ? '<BR>['.l10n('adviser').']' : ''),
+					'EMAIL'            => get_email_address_as_display_text($local_user['email']),
+         	'GROUPS'           => $groups_string,
+         	'REGISTRATION'     => $local_user['registration_date'],
+          'REMINDER'         => $reminder,    
+         	'EXPIRATION'       => $expiration,
 				)
 			);
@@ -1017,11 +1200,4 @@
 // +-----------------------------------------------------------------------+
 		check_status(ACCESS_ADMINISTRATOR);
-
-    $page['order_by_items'] = array(
-      'id' => l10n('registration_date'),
-      'username' => l10n('Username'),
-      'level' => l10n('Privacy level'),
-      'language' => l10n('language'),
-    );
 
 // +-----------------------------------------------------------------------+
@@ -1280,12 +1456,4 @@
     }
 
-    $template->assign(
-      array(
-        'F_ADD_ACTION' => $base_url,
-        'F_USERNAME' => @htmlentities($_GET['username']),
-        'F_FILTER_ACTION' => get_root_url().'admin.php'
-        )
-   	  );
-
 /* Hide radio-button if not allow to assign adviser */
 		if ($conf['allow_adviser'])
@@ -1294,5 +1462,19 @@
     	}
 
-	
+// +-----------------------------------------------------------------------+
+// |                            navigation bar                             |
+// +-----------------------------------------------------------------------+
+
+$url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
+
+$navbar = create_navigation_bar(
+  $url,
+  count($page['filtered_users']),
+  $start,
+  $conf['users_page']
+  );
+
+$template->assign('NAVBAR', $navbar);
+
 // +-----------------------------------------------------------------------+
 // |                               user list                               |
@@ -1316,4 +1498,5 @@
 
     $reminder = '';
+    
     if (isset($local_user['reminder']) and $local_user['reminder'] == 'true')
     {
@@ -1341,14 +1524,10 @@
      		'users',
        	array(
-       		'ID' => $local_user['id'],
-         	'CHECKED' => $checked,
-         	'USERNAME' => stripslashes($local_user['username'])
-						.($local_user['id'] == $conf['guest_id']
-						? '<BR />['.l10n('is_the_guest').']' : '')
-           	.($local_user['id'] == $conf['default_user_id']
-           	? '<BR />['.l10n('is_the_default').']' : ''),
-					'EMAIL' => get_email_address_as_display_text($local_user['email']),
-          'LASTVISIT' => $local_user['lastvisit'],
-          'REMINDER' => $reminder,
+       		'ID'         => $local_user['id'],
+         	'CHECKED'    => $checked,
+         	'USERNAME'   => stripslashes($local_user['username']),
+					'EMAIL'      => get_email_address_as_display_text($local_user['email']),
+          'LASTVISIT'  => $local_user['lastvisit'],
+          'REMINDER'   => $reminder,
 				)
 			);
@@ -1377,4 +1556,5 @@
 		array_push($page['infos'], l10n('Err_GhostTracker_Settings'));
   }
+
   break;
 }
Index: extensions/NBC_UserAdvManager/trunk/admin/ghosttracker.tpl
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/ghosttracker.tpl	(revision 4340)
+++ extensions/NBC_UserAdvManager/trunk/admin/ghosttracker.tpl	(revision 4380)
@@ -15,5 +15,5 @@
 
 		<li><label>{'UserAdvManager_GhostTracker_User_List'|@translate}</label><br><br>
-
+<div class="navigationBar">{$NAVBAR}</div>
 		<table class="table2" width="97%" summary="">
   			<thead>
@@ -23,5 +23,5 @@
       			<td>{'Email address'|@translate}</td>
             <td>{'LastVisit_Date'|@translate}</td>
-            <td>{'Ghost_Reminder'|@translate}</td>
+            <td>{'Reminder'|@translate}</td>
     			</tr>
   			</thead>
@@ -45,4 +45,5 @@
   		{/foreach}
 		</table>
+<div class="navigationBar">{$NAVBAR}</div>
     	<br>
 	    </li>
Index: extensions/NBC_UserAdvManager/trunk/admin/global.tpl
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 4340)
+++ extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 4380)
@@ -89,4 +89,9 @@
     	</li>
 {/if}
+
+    	<li><label>{'UserAdvManager_Add_LastVisit_Column'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_ADDLASTVISIT_TRUE} name="UserAdvManager_Add_LastVisit_Column">{'UserAdvManager_Add_LastVisit_Column_true'|@translate}<br>
+        <input type="radio" value="false" {$UserAdvManager_ADDLASTVISIT_FALSE} name="UserAdvManager_Add_LastVisit_Column">{'UserAdvManager_Add_LastVisit_Column_false'|@translate}<br><br>
+    	</li>
     </ul>
     
Index: extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl	(revision 4340)
+++ extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl	(revision 4380)
@@ -9,5 +9,5 @@
 		<li><label>{'UserAdvManager_ConfirmMail_User_List'|@translate}</label><br>
       <br>
-
+<div class="navigationBar">{$NAVBAR}</div>
 		<table class="table2" width="97%" summary="">
   			<thead>
@@ -19,4 +19,5 @@
       			<td>{'Groups'|@translate}</td>
       			<td>{'Registration_Date'|@translate}</td>
+            <td>{'Reminder'|@translate}</td>
     			</tr>
   			</thead>
@@ -30,4 +31,5 @@
     			<td>{$user.GROUPS}</td>
 					<td {if $user.EXPIRATION == True}style="color:red;text-align:center;"{else}style="color:lime;text-align:center;"{/if}>{$user.REGISTRATION}</td>
+          <td style="text-align:center;">{$user.REMINDER}</td>
     			{foreach from=$user.plugin_columns item=data}
     			<td>{$data}</td>
@@ -36,4 +38,5 @@
   		{/foreach}
 		</table>
+<div class="navigationBar">{$NAVBAR}</div>
     	<br>
 	    </li>
