Index: /extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 4142)
+++ /extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 4143)
@@ -63,6 +63,8 @@
 		$_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text']));
 		$_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text']));
-		
-		$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_ReminderText'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_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'];
 		
 		$conf['nbc_UserAdvManager'] = $newconf_nbc_UserAdvManager;
@@ -182,32 +184,34 @@
   $template->assign(
     array(
-		'UserAdvManager_MAIL_INFO_TRUE'       => $conf_nbc_UserAdvManager[0]=='true' ?  'checked="checked"' : '' ,
-		'UserAdvManager_MAIL_INFO_FALSE'      => $conf_nbc_UserAdvManager[0]=='false' ?  'checked="checked"' : '' ,
-		'UserAdvManager_MAILINFO_TEXT'        => $conf_nbc_UserAdvManager[10],
-		'UserAdvManager_NO_CASSE_TRUE'        => $conf_nbc_UserAdvManager[1]=='true' ?  'checked="checked"' : '' ,
-		'UserAdvManager_NO_CASSE_FALSE'       => $conf_nbc_UserAdvManager[1]=='false' ?  'checked="checked"' : '' ,
-		'UserAdvManager_USERNAME_CHAR_TRUE'   => $conf_nbc_UserAdvManager[7]=='true' ?  'checked="checked"' : '' ,
-		'UserAdvManager_USERNAME_CHAR_FALSE'  => $conf_nbc_UserAdvManager[7]=='false' ?  'checked="checked"' : '' ,
-		'UserAdvManager_USERNAME_CHAR_LIST'   => $conf_nbc_UserAdvManager[8],
-		'UserAdvManager_CONFIRM_MAIL_TRUE'    => $conf_nbc_UserAdvManager[2]=='true' ?  'checked="checked"' : '' ,
-		'UserAdvManager_CONFIRM_MAIL_FALSE'   => $conf_nbc_UserAdvManager[2]=='false' ?  'checked="checked"' : '' ,
-		'UserAdvManager_CONFIRMMAIL_TEXT'     => $conf_nbc_UserAdvManager[11],
-		'UserAdvManager_No_Confirm_Group'     => $conf_nbc_UserAdvManager[3],
-		'UserAdvManager_Validated_Group'      => $conf_nbc_UserAdvManager[4],
-		'UserAdvManager_No_Confirm_Status'    => $conf_nbc_UserAdvManager[9],
-		'UserAdvManager_Validated_Status'     => $conf_nbc_UserAdvManager[5],
-		'UserAdvManager_NO_COMMENT_ANO_TRUE'  => $conf_nbc_UserAdvManager[6]=='true' ?  'checked="checked"' : '' ,
-		'UserAdvManager_NO_COMMENT_ANO_FALSE' => $conf_nbc_UserAdvManager[6]=='false' ?  'checked="checked"' : '' ,
-		'UserAdvManager_MAILEXCLUSION_TRUE'   => $conf_nbc_UserAdvManager[12]=='true' ?  'checked="checked"' : '' ,
-		'UserAdvManager_MAILEXCLUSION_FALSE'  => $conf_nbc_UserAdvManager[12]=='false' ?  'checked="checked"' : '' ,
-		'UserAdvManager_MAILEXCLUSION_LIST'   => $conf_nbc_UserAdvManager[13],
-		'UserAdvManager_PASSWORDENF_TRUE'     => $conf_nbc_UserAdvManager[14]=='true' ?  'checked="checked"' : '' ,
-		'UserAdvManager_PASSWORDENF_FALSE'    => $conf_nbc_UserAdvManager[14]=='false' ?  'checked="checked"' : '' ,
-		'UserAdvManager_PASSWORD_SCORE'       => $conf_nbc_UserAdvManager[15],
-    'UserAdvManager_ADMINPASSWENF_TRUE'   => $conf_nbc_UserAdvManager[16]=='true' ?  'checked="checked"' : '' ,
-		'UserAdvManager_ADMINPASSWENF_FALSE'  => $conf_nbc_UserAdvManager[16]=='false' ?  'checked="checked"' : '' ,
-    'UserAdvManager_GHOSTRACKER_TRUE'     => $conf_nbc_UserAdvManager[17]=='true' ?  'checked="checked"' : '' ,
-		'UserAdvManager_GHOSTRACKER_FALSE'    => $conf_nbc_UserAdvManager[17]=='false' ?  'checked="checked"' : '' ,
-		'UserAdvManager_PASSWORD_TEST_SCORE'  => $UserAdvManager_Password_Test_Score,
+		'UserAdvManager_MAIL_INFO_TRUE'           => $conf_nbc_UserAdvManager[0]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAIL_INFO_FALSE'          => $conf_nbc_UserAdvManager[0]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAILINFO_TEXT'            => $conf_nbc_UserAdvManager[10],
+		'UserAdvManager_NO_CASSE_TRUE'            => $conf_nbc_UserAdvManager[1]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_NO_CASSE_FALSE'           => $conf_nbc_UserAdvManager[1]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_USERNAME_CHAR_TRUE'       => $conf_nbc_UserAdvManager[7]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_USERNAME_CHAR_FALSE'      => $conf_nbc_UserAdvManager[7]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_USERNAME_CHAR_LIST'       => $conf_nbc_UserAdvManager[8],
+		'UserAdvManager_CONFIRM_MAIL_TRUE'        => $conf_nbc_UserAdvManager[2]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_CONFIRM_MAIL_FALSE'       => $conf_nbc_UserAdvManager[2]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_CONFIRMMAIL_TEXT'         => $conf_nbc_UserAdvManager[11],
+		'UserAdvManager_No_Confirm_Group'         => $conf_nbc_UserAdvManager[3],
+		'UserAdvManager_Validated_Group'          => $conf_nbc_UserAdvManager[4],
+		'UserAdvManager_No_Confirm_Status'        => $conf_nbc_UserAdvManager[9],
+		'UserAdvManager_Validated_Status'         => $conf_nbc_UserAdvManager[5],
+		'UserAdvManager_NO_COMMENT_ANO_TRUE'      => $conf_nbc_UserAdvManager[6]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_NO_COMMENT_ANO_FALSE'     => $conf_nbc_UserAdvManager[6]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAILEXCLUSION_TRUE'       => $conf_nbc_UserAdvManager[12]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAILEXCLUSION_FALSE'      => $conf_nbc_UserAdvManager[12]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAILEXCLUSION_LIST'       => $conf_nbc_UserAdvManager[13],
+		'UserAdvManager_PASSWORDENF_TRUE'         => $conf_nbc_UserAdvManager[14]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_PASSWORDENF_FALSE'        => $conf_nbc_UserAdvManager[14]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_PASSWORD_SCORE'           => $conf_nbc_UserAdvManager[15],
+    'UserAdvManager_ADMINPASSWENF_TRUE'       => $conf_nbc_UserAdvManager[16]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_ADMINPASSWENF_FALSE'      => $conf_nbc_UserAdvManager[16]=='false' ?  'checked="checked"' : '' ,
+    'UserAdvManager_GHOSTRACKER_TRUE'         => $conf_nbc_UserAdvManager[17]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_GHOSTRACKER_FALSE'        => $conf_nbc_UserAdvManager[17]=='false' ?  'checked="checked"' : '' ,
+    'UserAdvManager_GHOSTRACKER_DAYLIMIT'     => $conf_nbc_UserAdvManager[18],
+    'UserAdvManager_GHOSTRACKER_REMINDERTEXT' => $conf_nbc_UserAdvManager[19],
+		'UserAdvManager_PASSWORD_TEST_SCORE'      => $UserAdvManager_Password_Test_Score,
     )
   );
@@ -958,5 +962,5 @@
 // +-----------------------------------------------------------------------+
 
-		$page['filtered_users'] = get_unvalid_user_list();
+		$page['filtered_users'] = get_ghost_user_list();
 
 // +-----------------------------------------------------------------------+
@@ -1041,10 +1045,10 @@
 
 // +-----------------------------------------------------------------------+
-// |                 Resend new validation key to users                    |
+// |                          Send ghost reminder                          |
 // +-----------------------------------------------------------------------+
 // +-----------------------------------------------------------------------+
 // |                            selected users                             |
 // +-----------------------------------------------------------------------+
-		if (isset($_POST['Mail_With_Key']))
+		if (isset($_POST['Reminder_Email']))
 		{
   		$collection = array();
@@ -1076,24 +1080,24 @@
 		}
 // +-----------------------------------------------------------------------+
-// |                 Resend new validation key to users                    |
-// +-----------------------------------------------------------------------+
-		if (isset($_POST['Mail_With_Key']) and count($collection) > 0)
+// |                         Send ghost reminder                           |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Reminder_Email']) and count($collection) > 0)
 		{
 			if (in_array($conf['guest_id'], $collection))
    		{
-    		array_push($page['errors'], l10n('No_validation_for_Guest'));
+    		array_push($page['errors'], l10n('No_reminder_for_Guest'));
     	}
     	if (($conf['guest_id'] != $conf['default_user_id']) and
     		in_array($conf['default_user_id'], $collection))
     	{
-    		array_push($page['errors'], l10n('No_validation_for_default_user'));
+    		array_push($page['errors'], l10n('No_reminder_for_default_user'));
     	}
    		if (in_array($conf['webmaster_id'], $collection))
     	{
-    		array_push($page['errors'], l10n('No_validation_for_Webmaster'));
+    		array_push($page['errors'], l10n('No_reminder_for_Webmaster'));
     	}
     	if (in_array($user['id'], $collection))
     	{
-    		array_push($page['errors'], l10n('No_validation_for_your_account'));
+    		array_push($page['errors'], l10n('No_reminder_for_your_account'));
     	}
 
@@ -1101,90 +1105,5 @@
     	{
     		foreach ($collection as $user_id)
-      	{     	
-      		$typemail = 1;
-				  $query = "
-						SELECT id, username, mail_address
-						FROM ".USERS_TABLE."
-						WHERE id = '".$user_id."'
-						;";
-					$data = mysql_fetch_array(pwg_query($query));
-				
-      		ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],true);
-      	}
-      	array_push(
-      		$page['infos'],
-        	l10n_dec(
-        		'%d_Mail_With_Key', '%d_Mails_With_Key',
-        	count($collection)
-        	)
-      	);
-      	
-				$page['filtered_users'] = get_unvalid_user_list();
-			}
-		}
-
-// +-----------------------------------------------------------------------+
-// |             Send reminder without new key to users                    |
-// +-----------------------------------------------------------------------+
-// +-----------------------------------------------------------------------+
-// |                            selected users                             |
-// +-----------------------------------------------------------------------+
-		if (isset($_POST['Mail_Without_Key']))
-		{
-  		$collection = array();
-
-			switch ($_POST['target'])
-    	{
-    		case 'all' :
-      	{
-      		foreach($page['filtered_users'] as $local_user)
-        	{
-        		array_push($collection, $local_user['id']);
-        	}
-        	break;
-				}
-      	case 'selection' :
-      	{
-      		if (isset($_POST['selection']))
-        	{
-        		$collection = $_POST['selection'];
-        	}
-        	break;
-      	}
-			}
-
-    	if (count($collection) == 0)
-    	{
-    		array_push($page['errors'], l10n('Select at least one user'));
-    	}
-		}
-// +-----------------------------------------------------------------------+
-// |             Send reminder without new key to users                    |
-// +-----------------------------------------------------------------------+
-		if (isset($_POST['Mail_Without_Key']) and count($collection) > 0)
-		{
-			if (in_array($conf['guest_id'], $collection))
-   		{
-    		array_push($page['errors'], l10n('No_validation_for_Guest'));
-    	}
-    	if (($conf['guest_id'] != $conf['default_user_id']) and
-    		in_array($conf['default_user_id'], $collection))
-    	{
-    		array_push($page['errors'], l10n('No_validation_for_default_user'));
-    	}
-   		if (in_array($conf['webmaster_id'], $collection))
-    	{
-    		array_push($page['errors'], l10n('No_validation_for_Webmaster'));
-    	}
-    	if (in_array($user['id'], $collection))
-    	{
-    		array_push($page['errors'], l10n('No_validation_for_your_account'));
-    	}
-
-    	if (count($page['errors']) == 0)
-    	{
-    		foreach ($collection as $user_id)
-      	{
-      		$typemail = 2;
+      	{
 				  $query = "
 						SELECT id, username, mail_address
@@ -1195,5 +1114,5 @@
 					$data = mysql_fetch_array(pwg_query($query));
 				
-      		ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],false);				
+      		ghostreminder($user_id,$data['username'],$data['mail_address']);				
       	}
       	array_push(
@@ -1205,111 +1124,7 @@
       	);
       	
-				$page['filtered_users'] = get_unvalid_user_list();
-			}
-		}
-
-// +-----------------------------------------------------------------------+
-// |             								Force validation					                 |
-// +-----------------------------------------------------------------------+
-// +-----------------------------------------------------------------------+
-// |                            selected users                             |
-// +-----------------------------------------------------------------------+
-		if (isset($_POST['Force_Validation']))
-		{
-  		$collection = array();
-
-			switch ($_POST['target'])
-    	{
-    		case 'all' :
-      	{
-      		foreach($page['filtered_users'] as $local_user)
-        	{
-        		array_push($collection, $local_user['id']);
-        	}
-        	break;
-				}
-      	case 'selection' :
-      	{
-      		if (isset($_POST['selection']))
-        	{
-        		$collection = $_POST['selection'];
-        	}
-        	break;
-      	}
-			}
-
-    	if (count($collection) == 0)
-    	{
-    		array_push($page['errors'], l10n('Select at least one user'));
-    	}
-		}
-// +-----------------------------------------------------------------------+
-// |             								Force validation					                 |
-// +-----------------------------------------------------------------------+
-		if (isset($_POST['Force_Validation']) and count($collection) > 0)
-		{
-			if (in_array($conf['guest_id'], $collection))
-   		{
-    		array_push($page['errors'], l10n('No_validation_for_Guest'));
-    	}
-    	if (($conf['guest_id'] != $conf['default_user_id']) and
-    		in_array($conf['default_user_id'], $collection))
-    	{
-    		array_push($page['errors'], l10n('No_validation_for_default_user'));
-    	}
-   		if (in_array($conf['webmaster_id'], $collection))
-    	{
-    		array_push($page['errors'], l10n('No_validation_for_Webmaster'));
-    	}
-    	if (in_array($user['id'], $collection))
-    	{
-    		array_push($page['errors'], l10n('No_validation_for_your_account'));
-    	}
-
-    	if (count($page['errors']) == 0)
-    	{
-    		foreach ($collection as $user_id)
-      	{
-				  $query = "
-						SELECT id, username, mail_address
-						FROM ".USERS_TABLE."
-						WHERE id = '".$user_id."'
-					;";
-					
-					$data = mysql_fetch_array(pwg_query($query));
-				
-      		ForceValidation($data['id']);				
-      	}
-      	array_push(
-      		$page['infos'],
-        	l10n_dec(
-        		'%d_Validated_User', '%d_Validated_Users',
-       		count($collection)
-        	)
-      	);
-
-				$page['filtered_users'] = get_unvalid_user_list();
-			}
-		}
-		
-
-// +-----------------------------------------------------------------------+
-// |                              groups list                              |
-// +-----------------------------------------------------------------------+
-
-		$groups[-1] = '------------';
-
-    $query = '
-      SELECT id, name
-      FROM '.GROUPS_TABLE.'
-      ORDER BY name ASC
-      ;';
-
-		$result = pwg_query($query);
-          
-    while ($row = mysql_fetch_array($result))
-    {
-      $groups[$row['id']] = $row['name'];
-    }
+				$page['filtered_users'] = get_ghost_user_list();
+			}
+		}
 
 // +-----------------------------------------------------------------------+
@@ -1341,10 +1156,8 @@
     	}
 
+	
 // +-----------------------------------------------------------------------+
 // |                               user list                               |
 // +-----------------------------------------------------------------------+
-
-		$profile_url = get_root_url().'admin.php?page=profile&amp;user_id=';
-		$perm_url = get_root_url().'admin.php?page=user_perm&amp;user_id=';
 
     $visible_user_list = array();
@@ -1363,16 +1176,17 @@
       $visible_user_list[] = $local_user;
 		}
-    
+
+    $reminder = '';
+    if (isset($local_user['reminder']) and $local_user['reminder'] == 'true')
+    {
+      $reminder = l10n('Reminder_Sent_OK');
+    }
+    else if (isset($local_user['reminder']) and $local_user['reminder'] == 'false')
+    {
+      $reminder = l10n('Reminder_Sent_NOK');
+    }
+
 		foreach ($visible_user_list as $local_user)
     {
-      $groups_string = preg_replace(
-      	'/(\d+)/e',
-        "\$groups['$1']",
-        implode(
-        	', ',
-            $local_user['groups']
-         )
-			);
-
 	  	if (isset($_POST['pref_submit'])
     		and isset($_POST['selection'])
@@ -1386,15 +1200,4 @@
     	}
 
-    	$properties = array();
-    	if ( $local_user['level'] != 0 )
-			{
-    		$properties[] = l10n( sprintf('Level %d', $local_user['level']) );
-			}
-    	$properties[] =
-    		(isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true'))
-      		? l10n('is_high_enabled') : l10n('is_high_disabled');
-
-			$expiration = expiration($local_user['id']);
-              
    		$template->append(
      		'users',
@@ -1402,6 +1205,4 @@
        		'ID' => $local_user['id'],
          	'CHECKED' => $checked,
-         	'U_PROFILE' => $profile_url.$local_user['id'],
-         	'U_PERM' => $perm_url.$local_user['id'],
          	'USERNAME' => $local_user['username']
 						.($local_user['id'] == $conf['guest_id']
@@ -1409,11 +1210,7 @@
            	.($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,
+          'LASTVISIT' => $local_user['lastvisit'],
+          'REMINDER' => $reminder,
 				)
 			);
@@ -1436,11 +1233,11 @@
 // +-----------------------------------------------------------------------+
 		$template->set_filename('plugin_admin_content', dirname(__FILE__) . '/ghosttracker.tpl');
-    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
-  }
+    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');		
+	}
   else
   {
 		array_push($page['infos'], l10n('Err_GhostTracker_Settings'));
   }
-  break; 
+  break;
 }
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/admin/confirmmail.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/admin/confirmmail.tpl	(revision 4142)
+++ /extensions/NBC_UserAdvManager/trunk/admin/confirmmail.tpl	(revision 4143)
@@ -9,32 +9,25 @@
     	<li><label>{'UserAdvManager_ConfirmMail_Info'|@translate}</label><br>
         <input type="radio" value="true" {$UserAdvManager_CONFIRMMAIL_TIMEOUT_TRUE} name="UserAdvManager_ConfirmMail_TimeOut"/> {'UserAdvManager_ConfirmMail_TimeOut_true'|@translate}<br>
-        <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_TIMEOUT_FALSE} name="UserAdvManager_ConfirmMail_TimeOut"/> {'UserAdvManager_ConfirmMail_TimeOut_false'|@translate}<br>
-      <br>
+        <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_TIMEOUT_FALSE} name="UserAdvManager_ConfirmMail_TimeOut"/> {'UserAdvManager_ConfirmMail_TimeOut_false'|@translate}<br><br>
     	</li>
-		<li><label>{'UserAdvManager_ConfirmMail_Delay_Info'|@translate}</label><input type="text" name="UserAdvManager_ConfirmMail_Delay" value="{$UserAdvManager_CONFIRMMAIL_DELAY}" size="5" style="text-align: center;"/><br>
-      <br>
+		<li><label>{'UserAdvManager_ConfirmMail_Delay_Info'|@translate}</label><input type="text" name="UserAdvManager_ConfirmMail_Delay" value="{$UserAdvManager_CONFIRMMAIL_DELAY}" size="5" style="text-align: center;"/><br><br>
 		</li>
     <li><label>{'UserAdvManager_ConfirmMail_Remail'|@translate}</label><br>
     	<input type="radio" value="true" {$UserAdvManager_CONFIRMMAIL_REMAIL_TRUE} name="UserAdvManager_ConfirmMail_Remail"/> {'UserAdvManager_ConfirmMail_Remail_true'|@translate}<br>
-      <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_REMAIL_FALSE} name="UserAdvManager_ConfirmMail_Remail"/> {'UserAdvManager_ConfirmMail_Remail_false'|@translate}<br>
-    <br>
+      <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_REMAIL_FALSE} name="UserAdvManager_ConfirmMail_Remail"/> {'UserAdvManager_ConfirmMail_Remail_false'|@translate}<br><br>
     </li>
  	{if $UserAdvManager_CONFIRMMAIL_REMAIL_TRUE}
 		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br>
-		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea>
-    <br><br>
+		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
 	  </li>
 		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br>
-		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea>
-    <br>
+		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
 	  </li>
   {else}
 		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br>
-		<textarea  name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" readonly{$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea>
-    <br><br>
+		<textarea  name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" readonly{$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
 	  </li>
 		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br>
-		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea>
-    <br>
+		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
 	  </li>
 	{/if}
Index: /extensions/NBC_UserAdvManager/trunk/admin/global.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 4142)
+++ /extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 4143)
@@ -21,10 +21,10 @@
         <input type="radio" value="true" {$UserAdvManager_PASSWORDENF_TRUE} name="UserAdvManager_Password_Enforced">{'UserAdvManager_Password_Enforced_true'|@translate}
         <input type="text" name="UserAdvManager_Password_Score" value="{$UserAdvManager_PASSWORD_SCORE}" size="5" style="text-align: center;"><br><br>
-        
+{if $UserAdvManager_PASSWORDENF_TRUE}        
         <label>{'UserAdvManager_Password_Enforced_Info'|@translate}</label><br><br>
         {'UserAdvManager_PasswordTest'|@translate}<input type="text" name="UserAdvManager_Password_Test" value="{$UserAdvManager_PASSWORD_TEST}" size="50" style="text-align: left;">&nbsp;&nbsp;&nbsp;
         <input class="submit" type="submit" value="{'PasswordTest'|@translate}" name="PasswordTest" >&nbsp;&nbsp;&nbsp;
         {'UserAdvManager_ScoreTest'|@translate}{$UserAdvManager_PASSWORD_TEST_SCORE}<br><br>
-        
+{/if}        
         <input type="radio" value="false" {$UserAdvManager_PASSWORDENF_FALSE} name="UserAdvManager_Password_Enforced">{'UserAdvManager_Password_Enforced_false'|@translate}<br><br>
     	</li>
@@ -43,14 +43,22 @@
         <input type="radio" value="false" {$UserAdvManager_MAILEXCLUSION_FALSE} name="UserAdvManager_MailExclusion">{'UserAdvManager_MailExclusion_false'|@translate}<br><br>
     	</li>
-      
+{if $UserAdvManager_MAILEXCLUSION_TRUE}      
     	<li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
         <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea><br><br>
     	</li>
-
+{/if}
     	<li><label>{'UserAdvManager_GhostTracker'|@translate}</label><br>
         <input type="radio" value="true" {$UserAdvManager_GHOSTRACKER_TRUE} name="UserAdvManager_GhostUser_Tracker">{'UserAdvManager_GhostTracker_true'|@translate}<br>
         <input type="radio" value="false" {$UserAdvManager_GHOSTRACKER_FALSE} name="UserAdvManager_GhostUser_Tracker">{'UserAdvManager_GhostTracker_false'|@translate}<br><br>
     	</li>
+{if $UserAdvManager_GHOSTRACKER_TRUE}
+    	<li><label>{'UserAdvManager_GhostTracker_DayLimit'|@translate}</label><br>
+        <input type="text" name="UserAdvManager_GhostTracker_DayLimit" value="{$UserAdvManager_GHOSTRACKER_DAYLIMIT}" size="5" style="text-align: center;"><br><br>
+      </li>
 
+    	<li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br>
+        <textarea name="UserAdvManager_GhostTracker_ReminderText" id="UserAdvManager_GhostTracker_ReminderText" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_GHOSTRACKER_REMINDERTEXT}</textarea><br><br>
+    	</li>
+{/if}
     </ul>
     
@@ -65,18 +73,18 @@
         <input type="radio" value="false" {$UserAdvManager_MAIL_INFO_FALSE} name="UserAdvManager_Mail_Info">{'UserAdvManager_Mail_Info_false'|@translate}<br><br>
     	</li>
-      
+{if $UserAdvManager_MAIL_INFO_TRUE}       
     	<li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
         <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br>
     	</li>
-      
+{/if}
     	<li><label>{'UserAdvManager_Confirm_Mail'|@translate}</label><br>
         <input type="radio" value="true" {$UserAdvManager_CONFIRM_MAIL_TRUE} name="UserAdvManager_Confirm_Mail">{'UserAdvManager_Confirm_Mail_true'|@translate}<br>
         <input type="radio" value="false" {$UserAdvManager_CONFIRM_MAIL_FALSE} name="UserAdvManager_Confirm_Mail">{'UserAdvManager_Confirm_Mail_false'|@translate}<br><br>
     	</li>
-      
+{if $UserAdvManager_CONFIRM_MAIL_TRUE}      
     	<li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br>
         <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br>
     	</li>
-      
+{/if}
     	<br>
 			<div style="text-align: center; font-size: 1.1em; color: red;"><b>{'UserAdvManager_Confirm_Group_Notice'|@translate}</b></div>
Index: /extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl	(revision 4142)
+++ /extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl	(revision 4143)
@@ -24,5 +24,5 @@
 			{foreach from=$users item=user name=users_loop}
   				<tr class="{if $smarty.foreach.users_loop.index is odd}row1{else}row2{/if}">
-    			<td><input type="checkbox" name="selection[]" value="{$user.ID}" {$user.CHECKED} id="selection-{$user.ID}" /></td>
+    			<td><input type="checkbox" name="selection[]" value="{$user.ID}" {$user.CHECKED} id="selection-{$user.ID}" ></td>
     			<td><label for="selection-{$user.ID}">{$user.USERNAME}</label></td>
     			<td>{$user.STATUS}</td>
@@ -36,5 +36,5 @@
   		{/foreach}
 		</table>
-    	<br/>
+    	<br>
 	    </li>
     </ul>
@@ -42,6 +42,6 @@
 <p>
   {'target'|@translate}
-  <label><input type="radio" name="target" value="all" /> {'all'|@translate}</label>
-  <label><input type="radio" name="target" value="selection" checked="checked" /> {'selection'|@translate}</label>
+  <label><input type="radio" name="target" value="all" > {'all'|@translate}</label>
+  <label><input type="radio" name="target" value="selection" checked="checked" > {'selection'|@translate}</label>
 </p>
 
Index: /extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php	(revision 4142)
+++ /extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php	(revision 4143)
@@ -145,4 +145,38 @@
 
 
+/* Function called from UserAdvManager_admin.php to send a reminder mail for ghost users */
+function ghostreminder($user_id, $username, $email)
+{
+  global $conf;
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  
+	include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+  
+	$infos1_perso = "";
+
+  $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Ghost_remainder_of_%s', $username));
+      
+  if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[19]) and $conf_nbc_UserAdvManager[19] <> '' and isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[17] == 'true')
+  {
+    $infos1 = get_user_language_desc($conf_nbc_UserAdvManager[19])."\n\n";
+    resetlastvisit($user_id);
+  }
+
+  pwg_mail($email, array(
+    'subject' => $subject,
+    'content' => $infos1.get_absolute_root_url(),
+  ));
+
+/* ********************** */
+/* Email sending debugger */
+/* This is only to trace  */
+/* the send of emails for */
+/* debugging              */
+/* ********************** */  
+//  MailLog($email,$subject);
+/* ********************** */
+}
+
+
 /* Function called from functions AddConfirmMail and ResetConfirmMail for validation key generation */
 function FindAvailableConfirmMailID()
@@ -152,8 +186,8 @@
     $id = generate_key(16);
     $query = "
-      SELECT COUNT(*)
-      FROM ".USER_CONFIRM_MAIL_TABLE."
-      WHERE id = '".$id."'
-    ;";
+SELECT COUNT(*)
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE id = '".$id."'
+;";
     list($count) = mysql_fetch_row(pwg_query($query));
 
@@ -176,27 +210,27 @@
   {
     $query = "
-      SELECT status
-      FROM ".USER_INFOS_TABLE."
-      WHERE user_id = '".$user_id."'
-    ;";
+SELECT status
+FROM ".USER_INFOS_TABLE."
+WHERE user_id = '".$user_id."'
+;";
     list($status) = mysql_fetch_row(pwg_query($query));
     
     $query = "
-      INSERT INTO ".USER_CONFIRM_MAIL_TABLE."
-      (id, user_id, mail_address, status, date_check)
-      VALUES
-      ('".$Confirm_Mail_ID."', '".$user_id."', '".$email."', '".$status."', null)
-    ;";
+INSERT INTO ".USER_CONFIRM_MAIL_TABLE."
+  (id, user_id, mail_address, status, date_check)
+VALUES
+  ('".$Confirm_Mail_ID."', '".$user_id."', '".$email."', '".$status."', null)
+;";
     pwg_query($query);
 
     $query = "
-      DELETE FROM ".USER_GROUP_TABLE."
-      WHERE user_id = '".$user_id."'
-      AND (
-        group_id = '".$conf_nbc_UserAdvManager[3]."'
-			OR 
-        group_id = '".$conf_nbc_UserAdvManager[4]."'
-      )
-    ;";
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$user_id."'
+  AND (
+    group_id = '".$conf_nbc_UserAdvManager[3]."'
+  OR 
+    group_id = '".$conf_nbc_UserAdvManager[4]."'
+  )
+;";
     pwg_query($query);
 
@@ -204,8 +238,8 @@
     {
       $query = "
-        UPDATE ".USER_INFOS_TABLE."
-        SET status = '".$conf_nbc_UserAdvManager[9]."'
-        WHERE user_id = '".$user_id."'
-      ;";
+UPDATE ".USER_INFOS_TABLE."
+SET status = '".$conf_nbc_UserAdvManager[9]."'
+WHERE user_id = '".$user_id."'
+;";
       pwg_query($query);
     }
@@ -214,9 +248,9 @@
     {
       $query = "
-        INSERT INTO ".USER_GROUP_TABLE."
-        (user_id, group_id)
-        VALUES
-        ('".$user_id."', '".$conf_nbc_UserAdvManager[3]."')
-      ;";
+INSERT INTO ".USER_GROUP_TABLE."
+  (user_id, group_id)
+VALUES
+  ('".$user_id."', '".$conf_nbc_UserAdvManager[3]."')
+;";
       pwg_query($query);
     }
@@ -239,15 +273,15 @@
   { 
     $query = "
-			UPDATE ".USER_CONFIRM_MAIL_TABLE."
-			SET id = '".$Confirm_Mail_ID."'
-			WHERE user_id = '".$user_id."'
-    ;";
+UPDATE ".USER_CONFIRM_MAIL_TABLE."
+SET id = '".$Confirm_Mail_ID."'
+WHERE user_id = '".$user_id."'
+;";
     pwg_query($query);
 
 		$query = "
-    	UPDATE ".USER_INFOS_TABLE."
-      SET registration_date = '".$dbnow."'
-      WHERE user_id = '".$user_id."'
-      ;";
+UPDATE ".USER_INFOS_TABLE."
+SET registration_date = '".$dbnow."'
+WHERE user_id = '".$user_id."'
+;";
 		pwg_query($query);
     
@@ -257,11 +291,27 @@
 
 
+/* Function called from function_UserAdvManager.inc.php to reset last visit date after sending a reminder */
+function resetlastvisit($user_id)
+{
+  global $conf;
+
+  list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+  $query = "
+UPDATE ".USER_LASTVISIT_TABLE."
+SET lastvisit = '".$dbnow."'
+WHERE user_id = '".$user_id."'
+;";
+  pwg_query($query);
+}
+
+
 /* Function called from main.inc.php - Triggered on user deletion */
 function DeleteConfirmMail($user_id)
 {
   $query = "
-    DELETE FROM ".USER_CONFIRM_MAIL_TABLE."
-    WHERE user_id = '".$user_id."'
-  ;";
+DELETE FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE user_id = '".$user_id."'
+;";
   pwg_query($query);
 }
@@ -279,8 +329,8 @@
 
   $query = "
-    SELECT COUNT(*)
-    FROM ".USER_CONFIRM_MAIL_TABLE."
-    WHERE id = '".$id."'
-  ;";
+SELECT COUNT(*)
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE id = '".$id."'
+;";
   list($count) = mysql_fetch_row(pwg_query($query));
 
@@ -288,8 +338,8 @@
   {
     $query = "
-      SELECT user_id, status, date_check
-      FROM ".USER_CONFIRM_MAIL_TABLE."
-      WHERE id = '".$id."'
-    ;";
+SELECT user_id, status, date_check
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE id = '".$id."'
+;";
     $data = mysql_fetch_array(pwg_query($query));
         
@@ -297,8 +347,8 @@
     {
       $query = "
-        SELECT registration_date
-        FROM ".USER_INFOS_TABLE."
-        WHERE user_id = '".$data['user_id']."'
-      ;";
+SELECT registration_date
+FROM ".USER_INFOS_TABLE."
+WHERE user_id = '".$data['user_id']."'
+;";
       list($registration_date) = mysql_fetch_row(pwg_query($query));
 
@@ -328,8 +378,8 @@
 
 						$query = '
-							UPDATE '.USER_CONFIRM_MAIL_TABLE.'
-							SET date_check="'.$dbnow.'"
-							WHERE id = "'.$id.'"
-						;';
+UPDATE '.USER_CONFIRM_MAIL_TABLE.'
+SET date_check="'.$dbnow.'"
+WHERE id = "'.$id.'"
+;';
 						pwg_query($query);
       
@@ -337,8 +387,8 @@
 						{
 							$query = "
-								DELETE FROM ".USER_GROUP_TABLE."
-								WHERE user_id = '".$data['user_id']."'
-								AND group_id = '".$conf_nbc_UserAdvManager[3]."'
-							;";
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+  AND group_id = '".$conf_nbc_UserAdvManager[3]."'
+;";
 							pwg_query($query);
 						}
@@ -347,9 +397,9 @@
 						{
 							$query = "
-								INSERT INTO ".USER_GROUP_TABLE."
-									(user_id, group_id)
-								VALUES
-									('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
-								;";
+INSERT INTO ".USER_GROUP_TABLE."
+  (user_id, group_id)
+VALUES
+  ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
+;";
 							pwg_query($query);
 						}
@@ -358,8 +408,8 @@
 						{
 							$query = "
-								UPDATE ".USER_INFOS_TABLE."
-								SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
-								WHERE user_id = '".$data['user_id']."'
-							;";
+UPDATE ".USER_INFOS_TABLE."
+SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
+WHERE user_id = '".$data['user_id']."'
+;";
 							pwg_query($query);
 						}
@@ -380,8 +430,8 @@
 
 					$query = '
-						UPDATE '.USER_CONFIRM_MAIL_TABLE.'
-						SET date_check="'.$dbnow.'"
-						WHERE id = "'.$id.'"
-					;';
+UPDATE '.USER_CONFIRM_MAIL_TABLE.'
+SET date_check="'.$dbnow.'"
+WHERE id = "'.$id.'"
+;';
 					pwg_query($query);
       
@@ -389,8 +439,8 @@
 					{
 						$query = "
-							DELETE FROM ".USER_GROUP_TABLE."
-							WHERE user_id = '".$data['user_id']."'
-							AND group_id = '".$conf_nbc_UserAdvManager[3]."'
-						;";
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+AND group_id = '".$conf_nbc_UserAdvManager[3]."'
+;";
 						pwg_query($query);
 					}
@@ -399,16 +449,16 @@
 					{
 						$query = "
-							DELETE FROM ".USER_GROUP_TABLE."
-							WHERE user_id = '".$data['user_id']."'
-							AND group_id = '".$conf_nbc_UserAdvManager[4]."'
-						;";
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+AND group_id = '".$conf_nbc_UserAdvManager[4]."'
+;";
 						pwg_query($query);
 
 						$query = "
-							INSERT INTO ".USER_GROUP_TABLE."
-								(user_id, group_id)
-							VALUES
-								('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
-						;";
+INSERT INTO ".USER_GROUP_TABLE."
+  (user_id, group_id)
+VALUES
+  ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
+;";
 						pwg_query($query);
 					}
@@ -417,8 +467,8 @@
 					{
 						$query = "
-							UPDATE ".USER_INFOS_TABLE."
-							SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
-							WHERE user_id = '".$data['user_id']."'
-						;";
+UPDATE ".USER_INFOS_TABLE."
+SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
+WHERE user_id = '".$data['user_id']."'
+;";
 						pwg_query($query);
 					}
@@ -445,8 +495,8 @@
         
   $query = "
-    SELECT COUNT(*)
-    FROM ".USER_CONFIRM_MAIL_TABLE."
-    WHERE user_id = '".$id."'
-  ;";
+SELECT COUNT(*)
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE user_id = '".$id."'
+;";
   list($count) = mysql_fetch_row(pwg_query($query));
 
@@ -454,8 +504,8 @@
   {
     $query = "
-      SELECT user_id, status, date_check
-      FROM ".USER_CONFIRM_MAIL_TABLE."
-      WHERE user_id = '".$id."'
-    ;";
+SELECT user_id, status, date_check
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE user_id = '".$id."'
+;";
     $data = mysql_fetch_array(pwg_query($query));
 
@@ -465,8 +515,8 @@
 
 			$query = "
-				UPDATE ".USER_CONFIRM_MAIL_TABLE."
-				SET date_check='".$dbnow."'
-				WHERE user_id = '".$data['user_id']."'
-			;";
+UPDATE ".USER_CONFIRM_MAIL_TABLE."
+SET date_check='".$dbnow."'
+WHERE user_id = '".$data['user_id']."'
+;";
 			pwg_query($query);
 	     
@@ -474,8 +524,8 @@
 			{
 				$query = "
-					DELETE FROM ".USER_GROUP_TABLE."
-					WHERE user_id = '".$data['user_id']."'
-					AND group_id = '".$conf_nbc_UserAdvManager[3]."'
-				;";
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+  AND group_id = '".$conf_nbc_UserAdvManager[3]."'
+;";
 				pwg_query($query);
 			}
@@ -484,16 +534,16 @@
 			{
 				$query = "
-					DELETE FROM ".USER_GROUP_TABLE."
-					WHERE user_id = '".$data['user_id']."'
-					AND group_id = '".$conf_nbc_UserAdvManager[4]."'
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+  AND group_id = '".$conf_nbc_UserAdvManager[4]."'
 				;";
 				pwg_query($query);
 	
 				$query = "
-					INSERT INTO ".USER_GROUP_TABLE."
-						(user_id, group_id)
-					VALUES
-						('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
-				;";
+INSERT INTO ".USER_GROUP_TABLE."
+  (user_id, group_id)
+VALUES
+  ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
+;";
 				pwg_query($query);
 			}
@@ -502,8 +552,8 @@
 			{
 				$query = "
-					UPDATE ".USER_INFOS_TABLE."
-					SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
-					WHERE user_id = '".$data['user_id']."'
-				;";
+UPDATE ".USER_INFOS_TABLE."
+SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
+WHERE user_id = '".$data['user_id']."'
+;";
 				pwg_query($query);
 			}
@@ -523,8 +573,8 @@
   {
     $query = "
-      SELECT ".$conf['user_fields']['username']."
-      FROM ".USERS_TABLE."
-      WHERE LOWER(".$conf['user_fields']['username'].") = '".strtolower($username)."'
-    ;";
+SELECT ".$conf['user_fields']['username']."
+FROM ".USERS_TABLE."
+WHERE LOWER(".$conf['user_fields']['username'].") = '".strtolower($username)."'
+;";
     list($username) = mysql_fetch_row(pwg_query($query));
 
@@ -532,23 +582,4 @@
   }
 }
-
-
-/* Obsolete function - Check for single email in database */
-//function SearchMail($email)
-//{
-//  global $conf, $lang;
-//  
-//  if (isset($email))
-//  {
-//    $query = "
-//      SELECT COUNT(*)
-//      FROM ".USERS_TABLE."
-//      WHERE ".$conf['user_fields']['email']." = '".$email."'
-//    ;";
-//    list($nbr_mail) = mysql_fetch_row(pwg_query($query));
-//  
-//    return isset($nbr_mail) ? $nbr_mail : 0;
-//  }
-//}
 
 
@@ -612,38 +643,38 @@
 	/* search users depending expiration date */
   $query = '
-		SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
-										u.'.$conf['user_fields']['username'].' AS username,
-										u.'.$conf['user_fields']['email'].' AS email,
-										ui.status,
-										ui.adviser,
-										ui.enabled_high,
-										ui.level,
-										ui.registration_date
-		FROM '.USERS_TABLE.' AS u
-    INNER JOIN '.USER_INFOS_TABLE.' AS ui
-      ON u.'.$conf['user_fields']['id'].' = ui.user_id
-    LEFT JOIN '.USER_GROUP_TABLE.' AS ug
-      ON u.'.$conf['user_fields']['id'].' = ug.user_id
-		WHERE u.'.$conf['user_fields']['id'].' >= 3
-		AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'"
-			OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'")';
+SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
+                u.'.$conf['user_fields']['username'].' AS username,
+                u.'.$conf['user_fields']['email'].' AS email,
+                ui.status,
+                ui.adviser,
+                ui.enabled_high,
+                ui.level,
+                ui.registration_date
+FROM '.USERS_TABLE.' AS u
+  INNER JOIN '.USER_INFOS_TABLE.' AS ui
+    ON u.'.$conf['user_fields']['id'].' = ui.user_id
+  LEFT JOIN '.USER_GROUP_TABLE.' AS ug
+    ON u.'.$conf['user_fields']['id'].' = ug.user_id
+  WHERE u.'.$conf['user_fields']['id'].' >= 3
+    AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'"
+    OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'")';
 
 	if ($conf_nbc_UserAdvManager[3] <> '-1' and $conf_nbc_UserAdvManager[9] == '-1')
   {
     $query.= '
-    AND ug.group_id = '.$conf_nbc_UserAdvManager[3];
+  AND ug.group_id = '.$conf_nbc_UserAdvManager[3];
   }
   if ($conf_nbc_UserAdvManager[3] == '-1' and $conf_nbc_UserAdvManager[9] <> '-1')
   {
     $query.= '
-    AND ui.status = \''.$conf_nbc_UserAdvManager[9]."'";
+  AND ui.status = \''.$conf_nbc_UserAdvManager[9]."'";
   }
   if ($conf_nbc_UserAdvManager[3] <> '-1' and $conf_nbc_UserAdvManager[9] <> '-1')
   {
     $query.= '
-    AND ug.group_id = \''.$conf_nbc_UserAdvManager[3]."'";
+  AND ug.group_id = \''.$conf_nbc_UserAdvManager[3]."'";
   }
   $query.= '
-  ORDER BY id ASC
+ORDER BY id ASC
 ;';
 
@@ -670,8 +701,8 @@
   {
   	$query = '
-    	SELECT user_id, group_id
-			FROM '.USER_GROUP_TABLE.'
-      WHERE user_id IN ('.implode(',', $user_ids).')
-		;';
+SELECT user_id, group_id
+FROM '.USER_GROUP_TABLE.'
+WHERE user_id IN ('.implode(',', $user_ids).')
+;';
         
 		$result = pwg_query($query);
@@ -689,4 +720,49 @@
 }
 
+
+/* Function called from UserAdvManager.php - Get ghost users */
+function get_ghost_user_list()
+{
+	global $conf, $page;
+          
+	/* Get UserAdvManager configuration */
+	$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();  
+  
+  $users = array();
+
+	/* search users depending expiration date */
+  $query = '
+SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
+                u.'.$conf['user_fields']['username'].' AS username,
+                u.'.$conf['user_fields']['email'].' AS email,
+                lv.lastvisit,
+                lv.reminder
+FROM '.USERS_TABLE.' AS u
+  INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv
+    ON u.'.$conf['user_fields']['id'].' = lv.user_id
+WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_nbc_UserAdvManager[18].'")
+ORDER BY id ASC;';
+
+	$result = pwg_query($query);
+      
+  while ($row = mysql_fetch_array($result))
+  {
+  	$user = $row;
+    $user['groups'] = array();
+
+    array_push($users, $user);
+	}
+
+	/* add group lists */
+  $user_ids = array();
+  foreach ($users as $i => $user)
+  {
+  	$user_ids[$i] = $user['id'];
+	}
+
+	return $users;
+}
+
+
 /* Function called from UserAdvManager.php - to determine who is expired or not and giving a different display color */
 function expiration($id)
@@ -701,8 +777,8 @@
 	
 	$query = "
-  	SELECT registration_date
-    FROM ".USER_INFOS_TABLE."
-    WHERE user_id = '".$id."'
-    ;";
+SELECT registration_date
+FROM ".USER_INFOS_TABLE."
+WHERE user_id = '".$id."'
+;";
 	list($registration_date) = mysql_fetch_row(pwg_query($query));
 
@@ -734,4 +810,5 @@
 	}
 }
+
 
 /**
@@ -811,5 +888,5 @@
 }
 
-/* Function called from maintain.inc.php - to determine if database upgrade is needed */
+/* Function called from maintain.inc.php - to check if database upgrade is needed */
 function table_exist($table)
 {
Index: /extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 4142)
+++ /extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php	(revision 4143)
@@ -7,9 +7,9 @@
 
 /* Global Configuration Tab */
-$lang['Title_Tab1'] = 'UserAdvManager - Global Configuration';
-$lang['Tab_Global'] = 'Global Configuration';
+$lang['Title_Tab1'] = 'UserAdvManager - General Setup';
+$lang['Tab_Global'] = 'General Setup';
 $lang['UserAdvManager_Title1'] = 'Users registration management';
 $lang['UserAdvManager_Title2'] = 'Registration validation and groups / status management';
-$lang['UserAdvManager_Mail_Info'] = ' Mail information user';
+$lang['UserAdvManager_Mail_Info'] = ' Mail information user (<b style="color: green;">activate and save settings to display the customizable email content</b> - <b style="color: red;">Caution: If, after configuration, you disable this option, you will lose any related customizations!</b>).';
 $lang['UserAdvManager_Mail_Info_true'] = ' Send an information mail to the user when he registes or updates his profile.';
 $lang['UserAdvManager_Mail_Info_false'] = ' Turns off the sending of mail. (default)';
@@ -21,5 +21,5 @@
 $lang['UserAdvManager_Username_Char_true'] = ' The following characters will be forbidden for username choice';
 $lang['UserAdvManager_Username_Char_false'] = ' Use the default username charset control. (default)';
-$lang['UserAdvManager_Password_Enforced'] = 'Strengthening passwords - Enabling this option makes the seizure of the password required for visitors registration. Also, the password entered by the visitor will meet with a score of complexity.';
+$lang['UserAdvManager_Password_Enforced'] = 'Strengthening passwords - Enabling this option makes the seizure of the password required for visitors registration. Also, the password entered by the visitor will meet with a score of complexity (<b style="color: green;">activate and save settings to display more informations</b>).';
 $lang['UserAdvManager_Password_Enforced_Info'] = '<b style="text-decoration: underline; color: green;">Explanations:</b> <b style="color: green;">A password score is calculated on the basic parameters: length, type of characters used (letters, digits, uppercase, lowercase, special characters). If the password of the user does not score, the score reached is displayed with the minimal score to reach and an indication to increase the value of this score. To give you an idea, a score below 100 is considered "low complexity". Between 100 and 500, the complexity is increased and average. Beyond 500, that\'s Fort Knox! ;-)<br>You can do your passwords complexity tests by using the field below. This will allow you to get an idea of the score to define a custom complexity.</b>';
 $lang['UserAdvManager_PasswordTest'] = 'Passowrd to test : ';
@@ -31,5 +31,5 @@
 $lang['UserAdvManager_AdminPassword_Enforced_true'] = 'Enable strengthening passwords for admins.';
 $lang['UserAdvManager_AdminPassword_Enforced_false'] = 'Disable strengthening passwords for admins. (default)';
-$lang['UserAdvManager_Confirm_Mail'] = 'Email address confirmation';
+$lang['UserAdvManager_Confirm_Mail'] = 'Email address confirmation (<b style="color: green;">activate and save settings to display the customizable email content</b> - <b style="color: red;">Caution: If, after configuration, you disable this option, you will lose any related customizations!</b>).';
 $lang['UserAdvManager_Confirm_Mail_true'] = ' Send an email to user to allow him to validate his email and his registration.';
 $lang['UserAdvManager_Confirm_Mail_false'] = ' Use the default Piwigo registration system (without registration validation). (default)';
@@ -44,13 +44,13 @@
 $lang['UserAdvManager_No_Comment_Anonymous_true'] = ' The author field have to be filled to send a comment.';
 $lang['UserAdvManager_No_Comment_Anonymous_false'] = ' Use the default Piwigo settings on comments sending. (default)';
-$lang['UserAdvManager_MailExclusion'] = 'Email provider exclusion';
+$lang['UserAdvManager_MailExclusion'] = 'Email provider exclusion (<b style="color: green;">activate and save settings to display the exclusion list field</b> - <b style="color: red;">Caution: If, after configuration, you disable this option, you will lose any related customizations!</b>)';
 $lang['UserAdvManager_MailExclusion_true'] = ' Set the email provider exclusion ON (i.e. : @hotmail.* or @msn.*)';
 $lang['UserAdvManager_MailExclusion_false'] = ' Set the email provider exclusion OFF. (default)';
 $lang['UserAdvManager_MailExclusion_List'] = ' If email provider exclusion is set to ON, fill the email domains to exclude below. You have to use the following format :<br>@[domaine_name].[domaine_extension] - Example : @hotmail.com<br>Seperate the different domains with a comma (,)<br>';
-$lang['UserAdvManager_GhostTracker'] = 'Ghost Tracker - Allows to manage registered users according their last visit date (see the "Ghost Tracker" tab) :';
+$lang['UserAdvManager_GhostTracker'] = 'Ghost Tracker - Allows to manage registered users according their last visit date (<b style="color: green;">activate and save settings to display more options</b> - <b style="color: red;">Caution: If, after configuration, you disable this option, you will lose any related customizations!</b>) :';
 $lang['UserAdvManager_GhostTracker_true'] = ' Enable Ghost Tracker.';
 $lang['UserAdvManager_GhostTracker_false'] = ' Disable Ghost Tracker. (Default)';
-$lang['audit'] = 'Audit parameters';
-$lang['submit'] = 'Save parameters';
+$lang['UserAdvManager_GhostTracker_DayLimit'] = ' Type in here the maximum limit, in days, between two visits of a visitor. When this limit is reached, this visitor will appear in the table on "Ghost Tracker" tab.';
+$lang['UserAdvManager_GhostTracker_ReminderText'] = ' Text used in the email reminder sent to encourage visitors to come back to the gallery (NB: The text pre-filled at the plugin installation is given as an example).<br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
 
 
@@ -67,6 +67,6 @@
 $lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Enable email reminder';
 $lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Disable email reminder. (Default)';
-$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Custom content of the recall message with regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
-$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Custom content of the recall message without regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Custom content of the reminder message with regeneration of validation key.<br>If left blank, the reminder email will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled at the plugin installation is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Custom content of the reminder message without regeneration of validation key.<br>If left blank, the reminder email will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled at the plugin installation is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
 
 
@@ -87,4 +87,20 @@
 
 
+/* Ghost Tracker Tab */
+$lang['GhostTracker_Title'] = 'Advanced ghost visitors management';
+$lang['Title_Tab4'] = 'UserAdvManager - Ghost Tracker';
+$lang['Tab_GhostTracker'] = 'Ghost Tracker';
+$lang['UserAdvManager_GhostTracker_User_List'] = 'When Ghost Tracker is enabled, you will find below the list of registered visitors who have not returned since x days. "x" is the number of days configured in the General Setup tab. In addition, you will find a column indicating whether an email reminder has been sent to targeted visitors. So, you can see at a glance and treat visitors who have not taken account of the reminder.<br><br>In this view, you can:
+<br><br>
+- Manually delete accounts <b>(manual drain)</b>
+<br>
+- Generate email reminder <b>with resetting the last visit date</b>. This allows to give a wildcard to targeted visitors. If the visitor has already received a reminder, nothing prevents to resent a new mail which will reset again, in fact, the last visit date.
+<br>';
+$lang['LastVisit_Date'] = 'Last visit';
+$lang['Ghost_Reminder'] = 'Email reminder';
+$lang['Reminder_Sent_OK'] = 'YES';
+$lang['Reminder_Sent_NOK'] = 'NO';
+
+
 /* Mailing */
 $lang['infos_mail %s'] = '%s, please find here your information to login the gallery :';
@@ -96,4 +112,5 @@
 $lang['Reminder_with_key_of_%s'] = '%s, your validation key has been renewed';
 $lang['Reminder_without_key_of_%s'] = '%s, your validation key will expire';
+$lang['Ghost_remainder_of_%s'] = '%s, this is a reminder email';
 
 
@@ -126,7 +143,7 @@
 $lang['UserAdvManager_no_update_pwd'] = '[profile updated without password changed]';
 $lang['invalid_pwd'] = 'Invalid username or password !';
-$lang['Err_ConfirmMail_Settings'] = 'This page will be available only if "Email address confirmation" is activated in tab "Global Configuration".';
-$lang['Err_UserManager_Settings'] = 'This page is available only if "Enable limiting the registration deadline" is active in the "ConfirmMail Settings" tab and an unvalidated users group is set in "Global Configuration" tab.';
-$lang['Err_GhostTracker_Settings'] = 'This page is available only if "Ghost Tracker" is active in the "Global Configuration" tab.';
+$lang['Err_ConfirmMail_Settings'] = 'This page will be available only if "Email address confirmation" is activated in "General Setup" tab.';
+$lang['Err_UserManager_Settings'] = 'This page is available only if "Enable limiting the registration deadline" is active in the "ConfirmMail Settings" tab and an unvalidated users group is set in "General Setup" tab.';
+$lang['Err_GhostTracker_Settings'] = 'This page is available only if "Ghost Tracker" is active in the "General Setup" tab.';
 $lang['No_validation_for_Guest'] = 'The "Guest" account is not subject to validation';
 $lang['No_validation_for_default_user'] = 'The default account is not subject to validation';
@@ -134,4 +151,8 @@
 $lang['No_validation_for_your_account'] = 'You personnal admin account is not subject to validation';
 $lang['Database_Error'] = '<b><u>Warning! Critical integrity error in your database.</u></b><br><br>Please check the integrity of the #_user_confirm_mail table.';
+$lang['No_reminder_for_Guest'] = 'The "Guest" account is not subject to receive reminders from GhostTracker';
+$lang['No_reminder_for_default_user'] = 'The default account is not subject to receive reminders from GhostTracker';
+$lang['No_reminder_for_Webmaster'] = 'The "Webmaster" account is not subject to receive reminders from GhostTracker';
+$lang['No_reminder_for_your_account'] = 'You personnal admin account is not subject to receive reminders from GhostTracker';
 
 
@@ -146,7 +167,10 @@
 
 /* Action button names */
+$lang['audit'] = 'Audit settings';
+$lang['submit'] = 'Save settings';
 $lang['Delete_selected'] = 'Delete';
 $lang['Mail_without_key'] = 'Reminder without key';
 $lang['Mail_with_key'] = 'Reminder with key';
 $lang['Force_Validation'] = 'Forced validation';
+$lang['Reminder_Email'] = 'Email reminder';
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 4142)
+++ /extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 4143)
@@ -11,5 +11,5 @@
 $lang['UserAdvManager_Title1'] = 'Gestion de l\'inscription des utilisateurs';
 $lang['UserAdvManager_Title2'] = 'Validation d\'inscription et gestion de groupes / statuts';
-$lang['UserAdvManager_Mail_Info'] = 'Mail d\'information à l\'utilisateur';
+$lang['UserAdvManager_Mail_Info'] = 'Mail d\'information à l\'utilisateur (<b style="color: green;">activez puis sauvegardez pour afficher le contenu paramétrable du mail</b> - <b style="color: red;">Attention : Si, après configuration, vous désactivez cette option, vous perdrez les personnalisations s\'y afférant!</b>)';
 $lang['UserAdvManager_Mail_Info_true'] = ' Envoyer un mail à l\'utilisateur reprenant ses infos lors de son inscription ou la mise à jour de son profil.';
 $lang['UserAdvManager_Mail_Info_false'] = ' Désactive l\'envoi de mail d\'info. (valeur par défaut)';
@@ -21,5 +21,5 @@
 $lang['UserAdvManager_Username_Char_true'] = ' Interdire les caractères saisis dans le champs ci-après pour le nom d\'utilisateur lors de l\'inscription == ';
 $lang['UserAdvManager_Username_Char_false'] = ' Laisser le contrôle par défaut du nom d\'utilisateur. (valeur par défaut)';
-$lang['UserAdvManager_Password_Enforced'] = 'Renforcement des mots de passe - Activer cette option rend la saisie du mot de passe obligatoire à l\'inscription des visiteurs. De plus, le mot de passe saisi par le visiteur devra répondre à un score de complexité.';
+$lang['UserAdvManager_Password_Enforced'] = 'Renforcement des mots de passe - Activer cette option rend la saisie du mot de passe obligatoire à l\'inscription des visiteurs. De plus, le mot de passe saisi par le visiteur devra répondre à un score de complexité <b style="color: green;">(activez puis sauvegardez pour afficher plus d\'infos</b>).';
 $lang['UserAdvManager_Password_Enforced_Info'] = '<b style="text-decoration: underline; color: green;">Explications :</b> <b style="color: green;">Le score d\'un mot de passe est calculé en fonction des paramètres de base : longueur, types de caractères utilisés(lettres, chiffres, majuscules, minuscules, caractères spéciaux). Si le mot de passe de l\'utilisateur ne répond pas au score, le score réalisé est affiché ainsi que le score minimum à atteindre et une indication pour augmenter la valeur de ce score. Pour donner un ordre d\'idée, un score inférieur à 100 est considéré comme faible. Entre 100 et 500, la complexité est renforcée et dans la moyenne. Au dela de 500, c\'est Fort Knox !! ;-)<br>Vous pouvez faire vos essais de complexité d\'un mot de passe en utilisant le champ ci-dessous. Cela vous permettra de vous faire une idée du score à définir pour une complexité personnalisée.</b>';
 $lang['UserAdvManager_PasswordTest'] = 'Mot de passe à tester : ';
@@ -31,5 +31,5 @@
 $lang['UserAdvManager_AdminPassword_Enforced_true'] = 'Activer le renforcement des mots de passe pour les admins.';
 $lang['UserAdvManager_AdminPassword_Enforced_false'] = 'Désactiver le renforcement des mots de passe pour les admins. (valeur par défaut)';
-$lang['UserAdvManager_Confirm_Mail'] = 'Confirmation de l\'adresse email';
+$lang['UserAdvManager_Confirm_Mail'] = 'Confirmation de l\'adresse email (<b style="color: green;">activez puis sauvegardez pour afficher le contenu paramétrable du mail</b> - <b style="color: red;">Attention : Si, après configuration, vous désactivez cette option, vous perdrez les personnalisations s\'y afférant!</b>).';
 $lang['UserAdvManager_Confirm_Mail_true'] = ' Envoyer un mail permettant a l\'utilisateur de confirmer son adresse email et donc son compte utilisateur.';
 $lang['UserAdvManager_Confirm_Mail_false'] = ' Système d\'inscription et de mise à jour standard sans confirmation de l\'adresse email. (valeur par défaut)';
@@ -44,13 +44,13 @@
 $lang['UserAdvManager_No_Comment_Anonymous_true'] = ' Le champs auteur doit être renseigné pour enregistrer un commentaire.';
 $lang['UserAdvManager_No_Comment_Anonymous_false'] = ' Laisser le fonctionnement par défaut pour enregistrer un commentaire. (valeur par défaut)';
-$lang['UserAdvManager_MailExclusion'] = 'Exclusion des domaines de messagerie';
+$lang['UserAdvManager_MailExclusion'] = 'Exclusion des domaines de messagerie (<b style="color: green;">activez puis sauvegardez pour afficher le cadre de la liste des exclusions</b> - <b style="color: red;">Attention : Si, après configuration, vous désactivez cette option, vous perdrez les personnalisations s\'y afférant!</b>)';
 $lang['UserAdvManager_MailExclusion_true'] = ' Activer l\'exclusion des domaines de messagerie (par exemple @hotmail.* ou @msn.*)';
 $lang['UserAdvManager_MailExclusion_false'] = ' Désactiver l\'exclusion des domaines de messagerie. (valeur par défaut)';
 $lang['UserAdvManager_MailExclusion_List'] = ' Si l\'exclusion de domaines de messagerie est activée, saisissez les domaines à exclure ici. Il faut respecter le format suivant :<br>@[nom_du_domaine].[extension_du_domaine] - Exemple : @hotmail.com<br><br>Séparez les domaines par une virgule<br>';
-$lang['UserAdvManager_GhostTracker'] = 'Gestion des visiteurs fantômes - Permet de gérer les inscrits en fonction de leur date de dernière visite (voir onglet "Ghost Tracker") :';
+$lang['UserAdvManager_GhostTracker'] = 'Gestion des visiteurs fantômes - Permet de gérer les inscrits en fonction de leur date de dernière visite (<b style="color: green;">activez puis sauvegardez pour afficher plus d\'options</b> - <b style="color: red;">Attention : Si, après configuration, vous désactivez cette option, vous perdrez les personnalisations s\'y afférant!</b>) :';
 $lang['UserAdvManager_GhostTracker_true'] = ' Activer la gestion des visiteurs fantômes.';
 $lang['UserAdvManager_GhostTracker_false'] = ' Désactiver la gestion des visiteurs fantômes. (valeur par défaut)';
-$lang['audit'] = 'Auditer les paramètres';
-$lang['submit'] = 'Sauvegarder les paramètres';
+$lang['UserAdvManager_GhostTracker_DayLimit'] = ' Saisissez ici le délai maximum, en jours, entre deux visites d\'un visiteur. Lorsque ce délai est atteind, le visiteur en question apparaitra dans le tableau de l\'onglet "Ghost Tracker".';
+$lang['UserAdvManager_GhostTracker_ReminderText'] = ' Texte utilisé dans le mail de rappel envoyé à l\'utilisateur pour l\'inciter à revenir visiter la galerie (NB: Le texte pré-renseigné à l\'installation du plugin est donné à titre d\'exemple).<br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
 
 
@@ -67,6 +67,6 @@
 $lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Activer le rappel par mail.';
 $lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Désactiver le rappel par mail. (valeur par défaut)';
-$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Contenu personnalisé du message de rappel avec regénération de clé de validation.<br>Si laissé vide, le mail de rappel ne comportera que le lien de validation. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible <b>QUE</b> si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
-$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Contenu personnalisé du message de rappel sans regénération de clé de validation.<br>Si laissé vide, le mail de rappel sera vide. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible <b>QUE</b> si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Contenu personnalisé du message de rappel avec regénération de clé de validation.<br>Si laissé vide, le mail de rappel ne comportera que le lien de validation. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré-renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible <b>QUE</b> si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Contenu personnalisé du message de rappel sans regénération de clé de validation.<br>Si laissé vide, le mail de rappel sera vide. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré-renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible <b>QUE</b> si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
 
 
@@ -87,18 +87,18 @@
 
 
-/* UserManager Tab */
-$lang['UserManager_Title'] = 'Gestion avancée des visiteurs fantômes';
-$lang['Title_Tab3'] = 'UserAdvManager - Ghost Tracker';
+/* Ghost Tracker Tab */
+$lang['GhostTracker_Title'] = 'Gestion avancée des visiteurs fantômes';
+$lang['Title_Tab4'] = 'UserAdvManager - Ghost Tracker';
 $lang['Tab_GhostTracker'] = 'Ghost Tracker';
-$lang['UserAdvManager_ConfirmMail_User_List'] = 'Lorsque la limitation du délai d\'inscription est activée, vous trouverez ci-dessous la liste des utilisateurs en attente de validation d\'inscription <b style="text-decoration: underline;">qu\'ils soient ou pas</b> dans les délais pour la valider.<br><br>Dans cette vue, vous pouvez :
+$lang['UserAdvManager_GhostTracker_User_List'] = 'Lorsque la gestion des visiteurs fantômes est activée, vous trouverez ci-dessous la liste des visiteurs inscrits sur votre galerie et qui ne sont pas revenus depuis x jours. "x" étant le nombre de jours paramétrés dans l\'onglet de configuration générale. De plus, vous trouverez une colonne précisant si un mail de rappel a déjà été envoyé aux visiteurs ciblés, vous permettant de visualiser d\'un coup d\'oeil et traiter les visiteurs qui n\'auraient pas tenu compte du rappel.<br><br>Dans cette vue, vous pouvez :
 <br><br>
 - Supprimer manuellement les comptes <b>(purge manuelle)</b>
 <br>
-- Générer l\'email de rappel <b>sans génération</b> d\'une nouvelle clef. Rappel : Cette fonction ne réinitialise pas la date d\'inscription du visiteur ciblé et le délai d\'expiration est toujours d\'actualité.
-<br>
-- Générer l\'email de rappel <b>avec génération</b> d\'une nouvelle clef. Rappel : Cette fonction réinitialise également la date d\'inscription du visiteur ciblé ce qui équivaut à prolonger le délai de validation.<br>
-- Valider manuellement une inscription en attente de validation même si la date d\'expiration est révolue <b>(forçage de la validation)</b>.
+- Générer l\'email de rappel <b>avec réinitialisation de la date de dernière visite</b>. Ce qui permet de donner un "joker" au visiteur ciblé. Si le visiteur a déjà bénéficié d\'un mail de rappel, rien n\'empêche de renvoyer un nouveau mail qui réinitialisera, de fait, la date de dernière visite.
 <br>';
-$lang['Registration_Date'] = 'Date d\'enregistrement';
+$lang['LastVisit_Date'] = 'Date de dernière visite';
+$lang['Ghost_Reminder'] = 'Email de rappel';
+$lang['Reminder_Sent_OK'] = 'OUI';
+$lang['Reminder_Sent_NOK'] = 'NON';
 
 
@@ -150,4 +150,8 @@
 $lang['No_validation_for_your_account'] = 'Votre compte d\'admin n\'est pas soumis à validation';
 $lang['Database_Error'] = '<b><u>Attention ! Erreur critique d\'intégrité dans votre base de données.</u></b><br><br>Veuillez contrôler l\'intégrité de la table #_user_confirm_mail.';
+$lang['No_reminder_for_Guest'] = 'Le compte Guest n\'est pas soumis à recevoir des rappels du GhostTracker';
+$lang['No_reminder_for_default_user'] = 'Le compte par défaut n\'est pas soumis à recevoir des rappels du GhostTracker';
+$lang['No_reminder_for_Webmaster'] = 'Le compte du Webmaster n\'est pas soumis à recevoir des rappels du GhostTracker';
+$lang['No_reminder_for_your_account'] = 'Votre compte d\'admin n\'est pas soumis à recevoir des rappels du GhostTracker';
 
 
@@ -162,7 +166,10 @@
 
 /* Action button names */
+$lang['audit'] = 'Auditer les paramètres';
+$lang['submit'] = 'Sauvegarder les paramètres';
 $lang['Delete_selected'] = 'Supprimer';
 $lang['Mail_without_key'] = 'Rappel sans clé';
 $lang['Mail_with_key'] = 'Rappel avec clé';
 $lang['Force_Validation'] = 'Validation forcée';
+$lang['Reminder_Email'] = 'Email de rappel';
 ?>
Index: /extensions/NBC_UserAdvManager/trunk/main.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 4142)
+++ /extensions/NBC_UserAdvManager/trunk/main.inc.php	(revision 4143)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: NBC UserAdvManager
-Version: 2.12.0a
+Version: 2.12.0
 Description: Permet de renforcer les possibilités de gestion des utilisateurs - Enforce users management
 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
@@ -128,4 +128,49 @@
 }
 
+
+add_event_handler('loc_begin_index', 'UserAdvManager_GhostTracker');
+
+function UserAdvManager_GhostTracker()
+{
+  global $conf, $user;
+  
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+  if (isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[17] == 'true' and !is_admin() and !is_a_guest())
+  {
+
+    $userid = get_userid($user['username']);
+     	  
+    /* Looking for existing entry in last visit table */
+    $query = '
+SELECT *
+FROM '.USER_LASTVISIT_TABLE.'
+WHERE user_id = '.$userid.'
+;';
+        
+    $count = mysql_num_rows(pwg_query($query));
+         
+    if ($count == 0)
+    {
+      /* If not, data are inserted in table */
+      $query = '
+INSERT INTO '.USER_LASTVISIT_TABLE.' (user_id, lastvisit, reminder)
+VALUES ('.$userid.', now(), "false")
+;';
+      pwg_query($query);
+    }
+    else if ($count > 0)
+    {
+      /* If yes, data are updated in table */
+      $query = '
+UPDATE '.USER_LASTVISIT_TABLE.'
+SET lastvisit = now(), reminder = "false"
+WHERE user_id = '.$userid.'
+LIMIT 1
+;';
+      pwg_query($query);
+    }
+  }
+}
 
 
@@ -267,8 +312,8 @@
         {
           $query = '
-            SELECT '.$conf['user_fields']['email'].' AS email
-              FROM '.USERS_TABLE.'
-            WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
-            ;';
+SELECT '.$conf['user_fields']['email'].' AS email
+FROM '.USERS_TABLE.'
+WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+;';
           
           list($current_email) = mysql_fetch_row(pwg_query($query));
@@ -282,8 +327,8 @@
         {
           $query = '
-            SELECT '.$conf['user_fields']['username'].'
-              FROM '.USERS_TABLE.'
-            WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
-            ;';
+SELECT '.$conf['user_fields']['username'].'
+FROM '.USERS_TABLE.'
+WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+;';
         
           list($username) = mysql_fetch_row(pwg_query($query));
Index: /extensions/NBC_UserAdvManager/trunk/maintain.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/trunk/maintain.inc.php	(revision 4142)
+++ /extensions/NBC_UserAdvManager/trunk/maintain.inc.php	(revision 4143)
@@ -12,12 +12,20 @@
 	
   $q = '
-    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
-    VALUES ("nbc_UserAdvManager","true;false;false;-1;-1;-1;false;false;;-1;;;false;;false;100;false,false","Parametres du plugin nbc UserAdvManager")
+INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+VALUES ("nbc_UserAdvManager","true;false;false;-1;-1;-1;false;false;;-1;;;false;;false;100;false,false,10,Hello.
+	
+This is a reminder because a very long time passed since your last visit on our gallery. If you do not want anymore to use your access account, please let us know by replying to this email. Your account will be deleted.
+
+On receipt of this message and no new visit within 15 days, we would be obliged to automatically delete your account.
+
+Best regards,
+
+The admin of the gallery.","Parametres du plugin nbc UserAdvManager")
   ;';
   pwg_query($q);
 
   $q = '
-    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
-    VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;Hello.
+INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;Hello.
 		
 This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You have again 5 days to validate your registration.
@@ -32,25 +40,23 @@
 
 	$q = "
-    CREATE TABLE IF NOT EXISTS ".USER_CONFIRM_MAIL_TABLE." (
-      id varchar(50) NOT NULL default '',
-      user_id smallint(5) NOT NULL default '0',
-      mail_address varchar(255) default NULL,
-      status enum('webmaster','admin','normal','generic','guest') default NULL,
-      date_check datetime default NULL,
-      lastvisit DATETIME NULL DEFAULT NULL,
-      reminder ENUM('true','false') NULL DEFAULT NULL
-      PRIMARY KEY  (id)
-    )
-  ;";
+CREATE TABLE IF NOT EXISTS ".USER_CONFIRM_MAIL_TABLE." (
+  id varchar(50) NOT NULL default '',
+  user_id smallint(5) NOT NULL default '0',
+  mail_address varchar(255) default NULL,
+  status enum('webmaster','admin','normal','generic','guest') default NULL,
+  date_check datetime default NULL,
+PRIMARY KEY  (id)
+  )
+;";
   pwg_query($q);
 
 	$q = "
-    CREATE TABLE IF NOT EXISTS ".USER_LASTVISIT_TABLE." (
-      user_id SMALLINT(5) NOT NULL DEFAULT '0',
-      lastvisit DATETIME NULL DEFAULT NULL,
-      reminder ENUM('true','false') NULL,
-      PRIMARY KEY (`user_id`)
-    )
-  ;";
+CREATE TABLE IF NOT EXISTS ".USER_LASTVISIT_TABLE." (
+  user_id SMALLINT(5) NOT NULL DEFAULT '0',
+  lastvisit DATETIME NULL DEFAULT NULL,
+  reminder ENUM('true','false') NULL,
+PRIMARY KEY (`user_id`)
+  )
+;";
   pwg_query($q);
 }
@@ -62,8 +68,8 @@
 /* Check for upgrade from 2.10 */
 	  $query = '
-    SELECT *
-		  FROM '.CONFIG_TABLE.'
-    WHERE param = "nbc_UserAdvManager_ConfirmMail"
-  ;';
+SELECT *
+FROM '.CONFIG_TABLE.'
+WHERE param = "nbc_UserAdvManager_ConfirmMail"
+;';
   $count = mysql_num_rows(pwg_query($query)); 
   
@@ -90,7 +96,7 @@
   {
     $q = '
-      DELETE FROM '.CONFIG_TABLE.'
-      WHERE param="nbc_UserAdvManager"
-    ;';
+DELETE FROM '.CONFIG_TABLE.'
+WHERE param="nbc_UserAdvManager"
+;';
 
     pwg_query($q);
@@ -100,7 +106,7 @@
   {
     $q = '
-      DELETE FROM '.CONFIG_TABLE.'
-      WHERE param="nbc_UserAdvManager_ConfirmMail"
-    ;';
+DELETE FROM '.CONFIG_TABLE.'
+WHERE param="nbc_UserAdvManager_ConfirmMail"
+;';
 
     pwg_query($q);
@@ -120,6 +126,6 @@
 	  
   $q = '
-    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
-    VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;Hello.
+INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;Hello.
 		
 This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You have again 5 days to validate your registration.
@@ -145,24 +151,31 @@
   if ((!isset($conf_nbc_UserAdvManager[14]) and !isset($conf_nbc_UserAdvManager[15])) and !isset($conf_nbc_UserAdvManager[16]) and !isset($conf_nbc_UserAdvManager[17]))
   {
-    $upgrade_nbc_UserAdvManager = $conf_nbc_UserAdvManager[0].';'.$conf_nbc_UserAdvManager[1].';'.$conf_nbc_UserAdvManager[2].';'.$conf_nbc_UserAdvManager[3].';'.$conf_nbc_UserAdvManager[4].';'.$conf_nbc_UserAdvManager[5].';'.$conf_nbc_UserAdvManager[6].';'.$conf_nbc_UserAdvManager[7].';'.$conf_nbc_UserAdvManager[8].';'.$conf_nbc_UserAdvManager[9].';'.$conf_nbc_UserAdvManager[10].';'.$conf_nbc_UserAdvManager[11].';'.$conf_nbc_UserAdvManager[12].';'.$conf_nbc_UserAdvManager[13].';false;100;false;false';
+    $upgrade_nbc_UserAdvManager = $conf_nbc_UserAdvManager[0].';'.$conf_nbc_UserAdvManager[1].';'.$conf_nbc_UserAdvManager[2].';'.$conf_nbc_UserAdvManager[3].';'.$conf_nbc_UserAdvManager[4].';'.$conf_nbc_UserAdvManager[5].';'.$conf_nbc_UserAdvManager[6].';'.$conf_nbc_UserAdvManager[7].';'.$conf_nbc_UserAdvManager[8].';'.$conf_nbc_UserAdvManager[9].';'.$conf_nbc_UserAdvManager[10].';'.$conf_nbc_UserAdvManager[11].';'.$conf_nbc_UserAdvManager[12].';'.$conf_nbc_UserAdvManager[13].';false;100;false;false;10;Hello.
+	
+This is a reminder because a very long time passed since your last visit on our gallery. If you do not want anymore to use your access account, please let us know by replying to this email. Your account will be deleted.
+
+On receipt of this message and no new visit within 15 days, we would be obliged to automatically delete your account.
+
+Best regards,
+
+The admin of the gallery.';
 		
 		$query = '
-	  	UPDATE '.CONFIG_TABLE.'
-	  	SET value="'.$upgrade_nbc_UserAdvManager.'"
-	  	WHERE param="nbc_UserAdvManager"
-	  	LIMIT 1
-	  	;';
-		
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$upgrade_nbc_UserAdvManager.'"
+WHERE param="nbc_UserAdvManager"
+LIMIT 1
+;';
 		pwg_query($query);
   }
   
 	$q = "
-    CREATE TABLE IF NOT EXISTS ".USER_LASTVISIT_TABLE." (
-      user_id SMALLINT(5) NOT NULL DEFAULT '0',
-      lastvisit DATETIME NULL DEFAULT NULL,
-      reminder ENUM('true','false') NULL,
-      PRIMARY KEY (`user_id`)
-    )
-  ;";
+CREATE TABLE IF NOT EXISTS ".USER_LASTVISIT_TABLE." (
+  user_id SMALLINT(5) NOT NULL DEFAULT '0',
+  lastvisit DATETIME NULL DEFAULT NULL,
+  reminder ENUM('true','false') NULL,
+PRIMARY KEY (`user_id`)
+  )
+;";
   pwg_query($q);
 }
