Index: extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php	(revision 5056)
+++ extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php	(revision 5056)
@@ -0,0 +1,1594 @@
+<?php
+
+global $user, $lang, $conf, $errors;
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+if (!defined('NBC_UAM_PATH')) define('NBC_UAM_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+load_language('plugin.lang', NBC_UAM_PATH);
+load_language('help/plugin.lang', NBC_UAM_PATH);
+
+$page['global'] = array();
+$error = array();
+$pattern = '/;/';
+$replacement = '.';
+
+$UAM_Password_Test_Score = 0;
+$UAM_MailInfo_Error_Txt = false;
+$UAM_ConfirmMail_Error_Txt = false;
+$UAM_Reminder_Error_Txt = false;
+$UAM_ConfirmMail_Error_Txt1 = false;
+$UAM_ConfirmMail_Error_Txt2 = false;
+$UAM_Exclusionlist_Error = false;
+
+
+// +-----------------------------------------------------------------------+
+// |                            Tabssheet                                  |
+// +-----------------------------------------------------------------------+
+if (!isset($_GET['tab']))
+	$page['tab'] = 'global';
+else
+  $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('global',
+               l10n('Tab_Global'),
+               $my_base_url.'&amp;tab=global');
+  $tabsheet->add('userlist',
+                 l10n('Tab_UserList'),
+                 $my_base_url.'&amp;tab=userlist');
+$tabsheet->add('usermanager',
+               l10n('Tab_UserManager'),
+               $my_base_url.'&amp;tab=usermanager');
+$tabsheet->add('ghosttracker',
+               l10n('Tab_GhostTracker'),
+               $my_base_url.'&amp;tab=ghosttracker');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+
+// +-----------------------------------------------------------------------+
+// |                      Getting plugin version                           |
+// +-----------------------------------------------------------------------+
+$plugin =  PluginVer(NBC_UAM_PATH);
+$version = $plugin['version'] ;
+
+
+// +----------------------------------------------------------+
+// |            FCK Editor for email text fields              |
+// +----------------------------------------------------------+
+
+/* Standby because this may cause too many problems with (;) in text fields */
+//$toolbar = 'Basic';
+//$width = '750px';
+//$height = '300px';
+//$areas = array();
+//array_push( $areas,'UAM_MailInfo_Text','UAM_ConfirmMail_Text','UAM_GhostTracker_ReminderText','UAM_ConfirmMail_ReMail_Txt1','UAM_ConfirmMail_ReMail_Txt2');
+ 
+//if (function_exists('set_fckeditor_instance'))
+//  set_fckeditor_instance($areas, $toolbar, $width, $height);
+
+
+// +-----------------------------------------------------------------------+
+// |                            Tabssheet select                           |
+// +-----------------------------------------------------------------------+
+
+switch ($page['tab'])
+{
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                           Global Config                               |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'global':
+
+	if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_No_Casse']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_No_Comment_Anonymous']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker']))
+  {
+
+/* General configuration settings */
+		$_POST['UAM_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_MailInfo_Text']));
+    
+		$_POST['UAM_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Text']));
+
+    $_POST['UAM_GhostTracker_ReminderText'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GhostTracker_ReminderText']));
+
+
+/* Control of semicolons - Replaced by dots - Warning message is displayed */    
+    if ((preg_match($pattern, $_POST['UAM_MailInfo_Text'])) or (preg_match($pattern, $_POST['UAM_GhostTracker_ReminderText'])) or (preg_match($pattern, $_POST['UAM_ConfirmMail_Text'])))
+    {
+      if (preg_match($pattern, $_POST['UAM_MailInfo_Text']))
+      {
+        $_POST['UAM_MailInfo_Text'] = preg_replace($pattern, $replacement, $_POST['UAM_MailInfo_Text']);
+        $UAM_MailInfo_Error_Txt = true;
+      }
+      
+      if (preg_match($pattern, $_POST['UAM_ConfirmMail_Text']))
+      {
+        $_POST['UAM_ConfirmMail_Text'] = preg_replace($pattern, $replacement, $_POST['UAM_ConfirmMail_Text']);
+        $UAM_ConfirmMail_Error_Txt = true;
+      }
+      
+      if (preg_match($pattern, $_POST['UAM_GhostTracker_ReminderText']))
+      {
+        $_POST['UAM_GhostTracker_ReminderText'] = preg_replace($pattern, $replacement, $_POST['UAM_GhostTracker_ReminderText']);
+        $UAM_Reminder_Error_Txt = true;
+      }
+      
+      array_push($page['errors'], l10n('mail_text_error'));
+    }
+
+    /* Check if CR-LF exist at begining and end of mail exclusion list - If yes, removes them */
+    if (preg_match('/^[\s]+/', $_POST['UAM_MailExclusion_List']))
+    {
+      array_push($page['errors'], l10n('mail_exclusionlist_error'));
+      $UAM_Exclusionlist_Error = true;
+    }
+		
+		$newconf_UAM = array(
+      $_POST['UAM_Mail_Info'],
+      $_POST['UAM_No_Casse'],
+      $_POST['UAM_Confirm_Mail'],
+      (isset($_POST['UAM_No_Confirm_Group'])?$_POST['UAM_No_Confirm_Group']:''),
+      (isset($_POST['UAM_Validated_Group'])?$_POST['UAM_Validated_Group']:''),
+      (isset($_POST['UAM_Validated_Status'])?$_POST['UAM_Validated_Status']:''),
+      $_POST['UAM_No_Comment_Anonymous'],
+      $_POST['UAM_Username_Char'],
+      $_POST['UAM_Username_List'],
+      (isset($_POST['UAM_No_Confirm_Status'])?$_POST['UAM_No_Confirm_Status']:''),
+      $_POST['UAM_MailInfo_Text'],
+      $_POST['UAM_ConfirmMail_Text'],
+      $_POST['UAM_MailExclusion'],
+      $_POST['UAM_MailExclusion_List'],
+      $_POST['UAM_Password_Enforced'],
+      $_POST['UAM_Password_Score'],
+      $_POST['UAM_AdminPassword_Enforced'],
+      $_POST['UAM_GhostUser_Tracker'],
+      $_POST['UAM_GhostTracker_DayLimit'],
+      $_POST['UAM_GhostTracker_ReminderText'],
+      $_POST['UAM_Add_LastVisit_Column']);
+
+    $conf['nbc_UserAdvManager'] = serialize($newconf_UAM);
+
+		$query = '
+	  	UPDATE '.CONFIG_TABLE.'
+	  	SET value="'.addslashes($conf['nbc_UserAdvManager']).'"
+	  	WHERE param="nbc_UserAdvManager"
+	  	LIMIT 1
+	  	;';
+		
+		pwg_query($query);
+
+
+/* Email confirmation settings */
+    $_POST['UAM_ConfirmMail_ReMail_Txt1'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_ReMail_Txt1']));
+
+    $_POST['UAM_ConfirmMail_ReMail_Txt2'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_ReMail_Txt2']));
+
+/* Control of semicolons - Replaced by dots - Warning message displayed */
+    if ((preg_match($pattern, $_POST['UAM_ConfirmMail_ReMail_Txt1'])) or (preg_match($pattern, $_POST['UAM_ConfirmMail_ReMail_Txt2'])))
+    {
+      if ((preg_match($pattern, $_POST['UAM_ConfirmMail_ReMail_Txt1'])))
+      {
+        $_POST['UAM_ConfirmMail_ReMail_Txt1'] = preg_replace($pattern, $replacement, $_POST['UAM_ConfirmMail_ReMail_Txt1']);
+        $UAM_ConfirmMail_Error_Txt1 = true;
+      }
+      
+      if ((preg_match($pattern, $_POST['UAM_ConfirmMail_ReMail_Txt2'])))
+      {
+        $_POST['UAM_ConfirmMail_ReMail_Txt2'] = preg_replace($pattern, $replacement, $_POST['UAM_ConfirmMail_ReMail_Txt2']);
+        
+        $UAM_ConfirmMail_Error_Txt2 = true;
+      }
+      
+      array_push($page['errors'], l10n('mail_text_error'));
+    }
+
+	  $newconf_UAM_ConfirmMail = array (
+      $_POST['UAM_ConfirmMail_TimeOut'],
+      $_POST['UAM_ConfirmMail_Delay'],
+      $_POST['UAM_ConfirmMail_ReMail_Txt1'],
+      $_POST['UAM_ConfirmMail_Remail'],
+      $_POST['UAM_ConfirmMail_ReMail_Txt2']);
+
+    $conf['nbc_UserAdvManager_ConfirmMail'] = serialize($newconf_UAM_ConfirmMail);
+    
+	  $query = '
+      UPDATE '.CONFIG_TABLE.'
+			SET value="'.addslashes($conf['nbc_UserAdvManager_ConfirmMail']).'"
+			WHERE param="nbc_UserAdvManager_ConfirmMail"
+			LIMIT 1
+		;';
+
+		pwg_query($query);
+
+		array_push($page['infos'], l10n('UAM_save_config'));
+  }
+
+
+/* Testing password enforcement */
+  if (isset($_POST['PasswordTest']) and !is_adviser() and isset($_POST['UAM_Password_Test']) and !empty($_POST['UAM_Password_Test']))
+  {
+    $UAM_Password_Test_Score = testpassword($_POST['UAM_Password_Test']);
+  }
+  else if (isset($_POST['PasswordTest']) and !is_adviser() and empty($_POST['UAM_Password_Test']))
+  {
+    array_push($page['errors'], l10n('reg_err_login3'));
+  }
+
+  $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
+
+/* Group setting for unvalidated and validated users */
+  $groups[-1] = '---------';
+  $No_Valid = -1;
+  $Valid = -1;
+	
+/* Check groups list in database  */
+  $query = '
+SELECT id, name
+FROM '.GROUPS_TABLE.'
+ORDER BY name ASC
+;';
+	
+  $result = pwg_query($query);
+	
+  while ($row = mysql_fetch_assoc($result))
+  {
+    $groups[$row['id']] = $row['name'];
+/* configuration value for unvalidated users */
+    if (isset($conf_UAM[3]) and $conf_UAM[3] == $row['id'])
+    {
+	  	$No_Valid = $row['id'];
+		}
+/* configuration value for validated users */
+    if (isset($conf_UAM[4]) and $conf_UAM[4] == $row['id'])
+		{
+	  	$Valid = $row['id'];
+		}
+  }
+	
+/* Template initialization for unvalidated users group */
+  $template->assign(
+    'No_Confirm_Group',
+   	array(
+	  	'group_options'=> $groups,
+	  	'group_selected' => $No_Valid
+			)
+ 		);
+/* Template initialization for validated users group */
+  $template->assign(
+    'Validated_Group',
+		array(
+      'group_options'=> $groups,
+      'group_selected' => $Valid
+			)
+  	);
+	
+/* Status setting for unvalidated and validated users */
+  $status_options[-1] = '------------';
+  $No_Valid_Status = -1;
+  $Valid_Status = -1;
+	
+/* Get status values */
+  foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
+  {
+	  $status_options[$status] = l10n('user_status_'.$status);
+	  if (isset($conf_UAM[9]) and $conf_UAM[9] == $status)
+	  {
+	    $No_Valid_Status = $status;
+	  }
+	  
+/* Template initialization for unvalidated users group */
+      $template->assign(
+        'No_Confirm_Status',
+        array(
+					'Status_options' => $status_options,
+		  		'Status_selected' => $No_Valid_Status
+					)
+	  		);
+  }
+  
+/* Get status values */
+  foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
+  {
+	  $status_options[$status] = l10n('user_status_'.$status);
+	  if (isset($conf_UAM[5]) and $conf_UAM[5] == $status)
+		{
+		  $Valid_Status = $status;
+		}
+		
+/* Template initialization for unvalidated users group */
+      $template->assign(
+	    'Confirm_Status',
+	    array(
+		    'Status_options' => $status_options,
+		    'Status_selected' => $Valid_Status
+		    )
+	    );
+	}
+
+/* Save last opened paragraph in configuration tab */
+  $nb_para=(isset($_POST["nb_para"])) ? $_POST["nb_para"]:"";
+  $nb_para2=(isset($_POST["nb_para2"])) ? $_POST["nb_para2"]:"";
+
+  $conf_UAM_ConfirmMail = unserialize($conf['nbc_UserAdvManager_ConfirmMail']);
+  
+  $template->assign(
+    array(
+    'nb_para'                        => $nb_para,
+    'nb_para2'                       => $nb_para2,
+    'UAM_VERSION'                    => $version,
+    'NBC_UAM_PATH'                   => NBC_UAM_PATH,
+		'UAM_MAIL_INFO_TRUE'             => $conf_UAM[0]=='true' ?  'checked="checked"' : '' ,
+		'UAM_MAIL_INFO_FALSE'            => $conf_UAM[0]=='false' ?  'checked="checked"' : '' ,
+		'UAM_MAILINFO_TEXT'              => $conf_UAM[10],
+		'UAM_NO_CASSE_TRUE'              => $conf_UAM[1]=='true' ?  'checked="checked"' : '' ,
+		'UAM_NO_CASSE_FALSE'             => $conf_UAM[1]=='false' ?  'checked="checked"' : '' ,
+		'UAM_USERNAME_CHAR_TRUE'         => $conf_UAM[7]=='true' ?  'checked="checked"' : '' ,
+		'UAM_USERNAME_CHAR_FALSE'        => $conf_UAM[7]=='false' ?  'checked="checked"' : '' ,
+		'UAM_USERNAME_CHAR_LIST'         => $conf_UAM[8],
+		'UAM_CONFIRM_MAIL_TRUE'          => $conf_UAM[2]=='true' ?  'checked="checked"' : '' ,
+		'UAM_CONFIRM_MAIL_FALSE'         => $conf_UAM[2]=='false' ?  'checked="checked"' : '' ,
+		'UAM_CONFIRMMAIL_TEXT'           => $conf_UAM[11],
+		'UAM_No_Confirm_Group'           => $conf_UAM[3],
+		'UAM_Validated_Group'            => $conf_UAM[4],
+		'UAM_No_Confirm_Status'          => $conf_UAM[9],
+		'UAM_Validated_Status'           => $conf_UAM[5],
+		'UAM_NO_COMMENT_ANO_TRUE'        => $conf_UAM[6]=='true' ?  'checked="checked"' : '' ,
+		'UAM_NO_COMMENT_ANO_FALSE'       => $conf_UAM[6]=='false' ?  'checked="checked"' : '' ,
+		'UAM_MAILEXCLUSION_TRUE'         => $conf_UAM[12]=='true' ?  'checked="checked"' : '' ,
+		'UAM_MAILEXCLUSION_FALSE'        => $conf_UAM[12]=='false' ?  'checked="checked"' : '' ,
+		'UAM_MAILEXCLUSION_LIST'         => $conf_UAM[13],
+		'UAM_PASSWORDENF_TRUE'           => $conf_UAM[14]=='true' ?  'checked="checked"' : '' ,
+		'UAM_PASSWORDENF_FALSE'          => $conf_UAM[14]=='false' ?  'checked="checked"' : '' ,
+		'UAM_PASSWORD_SCORE'             => $conf_UAM[15],
+    'UAM_ADMINPASSWENF_TRUE'         => $conf_UAM[16]=='true' ?  'checked="checked"' : '' ,
+		'UAM_ADMINPASSWENF_FALSE'        => $conf_UAM[16]=='false' ?  'checked="checked"' : '' ,
+    'UAM_GHOSTRACKER_TRUE'           => $conf_UAM[17]=='true' ?  'checked="checked"' : '' ,
+		'UAM_GHOSTRACKER_FALSE'          => $conf_UAM[17]=='false' ?  'checked="checked"' : '' ,
+    'UAM_GHOSTRACKER_DAYLIMIT'       => $conf_UAM[18],
+    'UAM_GHOSTRACKER_REMINDERTEXT'   => $conf_UAM[19],
+    'UAM_ADDLASTVISIT_TRUE'          => $conf_UAM[20]=='true' ?  'checked="checked"' : '' ,
+    'UAM_ADDLASTVISIT_FALSE'         => $conf_UAM[20]=='false' ?  'checked="checked"' : '' ,
+		'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score,
+    'UAM_ERROR_REPORTS1'             => $UAM_MailInfo_Error_Txt,
+    'UAM_ERROR_REPORTS2'             => $UAM_ConfirmMail_Error_Txt,
+    'UAM_ERROR_REPORTS3'             => $UAM_Reminder_Error_Txt,
+    'UAM_ERROR_REPORTS4'             => $UAM_Exclusionlist_Error,
+		'UAM_CONFIRMMAIL_TIMEOUT_TRUE'	 => $conf_UAM_ConfirmMail[0]=='true' ?  'checked="checked"' : '' ,
+		'UAM_CONFIRMMAIL_TIMEOUT_FALSE'  => $conf_UAM_ConfirmMail[0]=='false' ?  'checked="checked"' : '' ,
+		'UAM_CONFIRMMAIL_DELAY'					 => $conf_UAM_ConfirmMail[1],
+    'UAM_CONFIRMMAIL_REMAIL_TRUE'		 => $conf_UAM_ConfirmMail[3]=='true' ? 'checked="checked"' : '',
+    'UAM_CONFIRMMAIL_REMAIL_FALSE'	 => $conf_UAM_ConfirmMail[3]=='false' ? 'checked="checked"' : '',
+    'UAM_CONFIRMMAIL_REMAIL_TXT1'		 => $conf_UAM_ConfirmMail[2],
+    'UAM_CONFIRMMAIL_REMAIL_TXT2'		 => $conf_UAM_ConfirmMail[4],
+    'UAM_ERROR_REPORTS1'             => $UAM_ConfirmMail_Error_Txt1,
+    'UAM_ERROR_REPORTS2'             => $UAM_ConfirmMail_Error_Txt2,
+    )
+  );
+
+  if (isset($_POST['audit']))
+	{
+		$msg_error1 = '';
+		
+/* username insensible a la casse */
+    if (isset($conf_UAM[3]) and $conf_UAM[3] == 'true')
+	  {
+			$query = "
+SELECT ".$conf['user_fields']['username']."
+  FROM ".USERS_TABLE." p1
+WHERE EXISTS(
+  SELECT ".$conf['user_fields']['username']."
+	 FROM ".USERS_TABLE." p2
+	WHERE p1.".$conf['user_fields']['id']." <> p2.".$conf['user_fields']['id']."
+	 AND LOWER(p1.".$conf['user_fields']['username'].") = LOWER(p2.".$conf['user_fields']['username'].")
+	)
+;";
+			  
+		  $result = pwg_query($query);
+			
+		  while($row = mysql_fetch_assoc($result))
+	  	{
+				$msg_error1 .= (($msg_error1 <> '') ? '<br/>' : '') . l10n('Err_audit_no_casse').stripslashes($row['username']);
+			}
+		}
+
+		$msg_error2 = '';
+		
+/* Username without forbidden keys */
+    if ( isset($conf_UAM[7]) and $conf_UAM[7] == 'true' )
+	  {
+			$query = "
+SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."
+  FROM ".USERS_TABLE."
+;";
+			  
+			$result = pwg_query($query);
+			
+			while($row = mysql_fetch_assoc($result))
+			{
+				if (!ValidateUsername(stripslashes($row['username'])))
+					$msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char').stripslashes($row['username']);
+			}
+		}
+
+		$msg_error3 = '';
+		
+/* Email without forbidden domain */
+    if ( isset($conf_UAM[12]) and $conf_UAM[12] == 'true' )
+	  {
+			$query = "
+SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."
+  FROM ".USERS_TABLE."
+;";
+			  
+		  $result = pwg_query($query);
+			
+		  while($row = mysql_fetch_assoc($result))
+		  {
+			  $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[13]);
+			  for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+			  {
+					$pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
+				  if (preg_match($pattern, $row['mail_address']))
+				  {
+						$msg_error3 .=  (($msg_error3 <> '') ? '<br/>' : '') . l10n('Err_audit_email_forbidden').stripslashes($row['username']).' ('.$row['mail_address'].')';
+					}
+				}
+			}
+		}
+		
+    if ($msg_error1 <> '')
+			$errors[] = $msg_error1.'<br/><br/>';
+		
+		if ($msg_error2 <> '')
+			$errors[] = $msg_error2.'<br/><br/>';
+		
+		if ($msg_error3 <> '')
+	  	$errors[] = $msg_error3.'<br/><br/>';
+		
+		if ($msg_error1 <> '' or $msg_error2 <> '' or $msg_error3 <> '')
+	  	array_push($page['errors'], l10n('Err_audit_advise'));
+		else
+    	array_push($page['infos'], l10n('UAM_audit_ok'));
+	}
+
+
+// +-----------------------------------------------------------------------+
+// |                             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__) . '/global.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+  break;
+
+
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                           Users list page                             |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'userlist':
+  
+  $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
+  
+  if (isset($conf_UAM[20]) and $conf_UAM[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_UAM[17]) and $conf_UAM[17]=='true' and $conf_UAM[18] <> '')
+      {
+        if ($deltadays <= ($conf_UAM[18]/2))
+        {
+          $display = 'green';
+        }
+        
+        if (($deltadays > ($conf_UAM[18]/2)) and ($deltadays < $conf_UAM[18]))
+        {
+          $display = 'orange';
+        }
+        
+        if ($deltadays >= $conf_UAM[18])
+        {
+          $display = 'red';
+        }
+        
+      }
+      /* Plugin version inserted */
+      $template->assign(
+        array(
+          'UAM_VERSION' => $version,
+          'NBC_UAM_PATH'=> NBC_UAM_PATH,
+          )
+        );
+
+   		$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                          |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'usermanager':
+
+  $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
+
+  $conf_UAM_ConfirmMail = unserialize($conf['nbc_UserAdvManager_ConfirmMail']);
+	
+  if (isset($conf_UAM[2]) and $conf_UAM[2]=='true' and ((isset($conf_UAM[3]) and $conf_UAM[3] <> '-1') or (isset($conf_UAM[9]) and $conf_UAM[9] <> '-1')) and isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0]=='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_unvalid_user_list();
+
+// +-----------------------------------------------------------------------+
+// |                            selected users                             |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Del_Selected']))
+		{
+  		$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'));
+   		}
+		}
+
+// +-----------------------------------------------------------------------+
+// |                             delete users                              |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Del_Selected']) and count($collection) > 0)
+  	{
+  		if (in_array($conf['guest_id'], $collection))
+   		{
+    		array_push($page['errors'], l10n('Guest cannot be deleted'));
+    	}
+    	if (($conf['guest_id'] != $conf['default_user_id']) and
+    		in_array($conf['default_user_id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('Default user cannot be deleted'));
+    	}
+    	if (in_array($conf['webmaster_id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('Webmaster cannot be deleted'));
+    	}
+    	if (in_array($user['id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('You cannot delete your account'));
+    	}
+
+			if (count($page['errors']) == 0)
+    	{
+    		foreach ($collection as $user_id)
+      	{
+      		delete_user($user_id);
+      	}
+     		array_push(
+      		$page['infos'],
+        	l10n_dec(
+        	'%d user deleted', '%d users deleted',
+        	count($collection)
+        	)
+      	);
+
+      	foreach ($page['filtered_users'] as $filter_key => $filter_user)
+      	{
+      		if (in_array($filter_user['id'], $collection))
+        	{
+        		unset($page['filtered_users'][$filter_key]);
+        	}
+     		}
+			}
+		}
+
+// +-----------------------------------------------------------------------+
+// |                 Resend new validation key to users                    |
+// +-----------------------------------------------------------------------+
+// +-----------------------------------------------------------------------+
+// |                            selected users                             |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Mail_With_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'));
+    	}
+		}
+// +-----------------------------------------------------------------------+
+// |                 Resend new validation key to users                    |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Mail_With_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 = 1;
+				  $query = "
+SELECT id, username, mail_address
+  FROM ".USERS_TABLE."
+WHERE id = '".$user_id."'
+;";
+					$data = mysql_fetch_assoc(pwg_query($query));
+				
+      		ResendMail2User($typemail,$user_id,stripslashes($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
+  FROM ".USERS_TABLE."
+WHERE id = '".$user_id."'
+;";
+					
+					$data = mysql_fetch_assoc(pwg_query($query));
+				
+      		ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],false);				
+      	}
+      	array_push(
+      		$page['infos'],
+        	l10n_dec(
+        		'%d_Reminder_Sent', '%d_Reminders_Sent',
+       		count($collection)
+        	)
+      	);
+        
+				$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_assoc(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_assoc($result))
+    {
+      $groups[$row['id']] = $row['name'];
+    }
+
+// +-----------------------------------------------------------------------+
+// |                           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;
+    }
+
+/* Hide radio-button if not allow to assign adviser */
+		if ($conf['allow_adviser'])
+    	{
+      	$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                               |
+// +-----------------------------------------------------------------------+
+
+		$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();
+    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)
+    {
+      $groups_string = preg_replace(
+      	'/(\d+)/e',
+        "\$groups['$1']",
+        implode(
+        	', ',
+            $local_user['groups']
+         )
+			);
+
+      $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'])
+      	and in_array($local_user['id'], $_POST['selection']))
+	  	{
+				$checked = 'checked="checked"';
+	  	}
+			else
+    	{
+    		$checked = '';
+    	}
+
+    	$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',
+       	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'],
+          'REMINDER'         => $reminder,    
+         	'EXPIRATION'       => $expiration,
+				)
+			);
+		}
+    /* Plugin version inserted */
+    $template->assign(
+      array(
+        'UAM_VERSION'      => $version,
+        'NBC_UAM_PATH'     => NBC_UAM_PATH,
+      )
+    );
+
+// +-----------------------------------------------------------------------+
+// |                             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__) . '/usermanager.tpl');
+    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');		
+	}
+  else
+  {
+		array_push($page['infos'], l10n('Err_UserManager_Settings'));
+  }
+  break;
+
+
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                           Ghost Tracker page                          |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'ghosttracker':
+
+  $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
+	
+  if (isset($conf_UAM[17]) and $conf_UAM[17]=='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_ghost_user_list();
+
+// +-----------------------------------------------------------------------+
+// |                            selected users                             |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Del_Selected']))
+		{
+  		$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'));
+   		}
+		}
+
+// +-----------------------------------------------------------------------+
+// |                             delete users                              |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Del_Selected']) and count($collection) > 0)
+  	{
+  		if (in_array($conf['guest_id'], $collection))
+   		{
+    		array_push($page['errors'], l10n('Guest cannot be deleted'));
+    	}
+    	if (($conf['guest_id'] != $conf['default_user_id']) and
+    		in_array($conf['default_user_id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('Default user cannot be deleted'));
+    	}
+    	if (in_array($conf['webmaster_id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('Webmaster cannot be deleted'));
+    	}
+    	if (in_array($user['id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('You cannot delete your account'));
+    	}
+
+			if (count($page['errors']) == 0)
+    	{
+    		foreach ($collection as $user_id)
+      	{
+      		delete_user($user_id);
+      	}
+     		array_push(
+      		$page['infos'],
+        	l10n_dec(
+        	'%d user deleted', '%d users deleted',
+        	count($collection)
+        	)
+      	);
+
+      	foreach ($page['filtered_users'] as $filter_key => $filter_user)
+      	{
+      		if (in_array($filter_user['id'], $collection))
+        	{
+        		unset($page['filtered_users'][$filter_key]);
+        	}
+     		}
+			}
+		}
+
+// +-----------------------------------------------------------------------+
+// |                          Send ghost reminder                          |
+// +-----------------------------------------------------------------------+
+// +-----------------------------------------------------------------------+
+// |                            selected users                             |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Reminder_Email']))
+		{
+  		$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 ghost reminder                           |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Reminder_Email']) and count($collection) > 0)
+		{
+			if (in_array($conf['guest_id'], $collection))
+   		{
+    		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_reminder_for_default_user'));
+    	}
+   		if (in_array($conf['webmaster_id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('No_reminder_for_Webmaster'));
+    	}
+    	if (in_array($user['id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('No_reminder_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_assoc(pwg_query($query));
+				
+      		ghostreminder($user_id,stripslashes($data['username']),$data['mail_address']);				
+      	}
+      	array_push(
+      		$page['infos'],
+        	l10n_dec(
+        		'%d_Reminder_Sent', '%d_Reminders_Sent',
+       		count($collection)
+        	)
+      	);
+      	
+				$page['filtered_users'] = get_ghost_user_list();
+			}
+		}
+    
+    if (isset($_POST['GhostTracker_Init']))
+    {
+      /* Reset is only allowed for admins ! */
+      if (is_admin() and !is_adviser())
+      {
+        $query1 = '
+SELECT *
+  FROM '.USER_LASTVISIT_TABLE.';';
+
+        $count = mysql_num_rows(pwg_query($query1));
+
+        if ($count <> 0)
+        {
+          $query = '
+SELECT DISTINCT u.id,
+                ui.status AS status
+FROM '.USERS_TABLE.' AS u
+  INNER JOIN '.USER_INFOS_TABLE.' AS ui
+    ON u.id = ui.user_id
+WHERE u.id NOT IN (SELECT user_id FROM '.USER_LASTVISIT_TABLE.')
+  AND status != "webmaster"
+  AND status != "guest"
+  AND status != "admin"
+ORDER BY u.id ASC
+;';
+
+          $result = pwg_query($query);
+          
+          while ($row = mysql_fetch_assoc($result))
+          {
+            list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+            
+            $query = "
+INSERT INTO ".USER_LASTVISIT_TABLE." (user_id, lastvisit, reminder)
+VALUES ('".$row['id']."','".$dbnow."','false')
+;";
+            pwg_query($query);
+          }
+        }
+        else if ($count == 0)
+        {
+          $query = '
+SELECT DISTINCT u.id,
+                ui.status AS status
+FROM '.USERS_TABLE.' AS u
+  INNER JOIN '.USER_INFOS_TABLE.' AS ui
+    ON u.id = ui.user_id
+WHERE status != "webmaster"
+  AND status != "guest"
+  AND status != "admin"
+ORDER BY u.id ASC
+;';
+
+          $result = pwg_query($query);
+          
+          while($row = mysql_fetch_assoc($result))
+          {
+            list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+            
+            $query = "
+INSERT INTO ".USER_LASTVISIT_TABLE." (user_id, lastvisit, reminder)
+VALUES ('".$row['id']."','".$dbnow."','false')
+;";
+            pwg_query($query);
+          }
+        }
+        
+        array_push($page['infos'], l10n('GhostTracker_Init_OK'));
+      }
+    }
+
+// +-----------------------------------------------------------------------+
+// |                           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;
+    }
+
+/* Hide radio-button if not allow to assign adviser */
+		if ($conf['allow_adviser'])
+    {
+      $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                               |
+// +-----------------------------------------------------------------------+
+
+    $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;
+		}
+
+/* Plugin version inserted */
+      $template->assign(
+        array(
+          'UAM_VERSION'      => $version,
+          'NBC_UAM_PATH'     => NBC_UAM_PATH,
+        )
+      );
+
+		foreach ($visible_user_list as $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');
+      }
+    
+      if (isset($_POST['pref_submit']) and isset($_POST['selection']) and in_array($local_user['id'], $_POST['selection']))
+	  	{
+				$checked = 'checked="checked"';
+	  	}
+			else
+    	{
+    		$checked = '';
+    	}
+
+      $template->append(
+     	  'users',
+       	array(
+       		'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,
+				)
+			);
+		}
+
+// +-----------------------------------------------------------------------+
+// |                             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__) . '/ghosttracker.tpl');
+    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');		
+	}
+  else
+  {
+		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 4997)
+++ extensions/NBC_UserAdvManager/trunk/admin/ghosttracker.tpl	(revision 5056)
@@ -17,10 +17,10 @@
 </div>
 
-<form method="post" action="{$UserAdvManager_F_ACTION}" class="general">
+<form method="post" action="{$UAM_F_ACTION}" class="general">
   <fieldset>
   	<legend>{'GT_Init'|@translate}</legend>
     <ul>
 		  <li>
-        <label>{'UserAdvManager_GhostTracker_Init'|@translate}</label><br><br>
+        <label>{'UAM_GhostTracker_Init'|@translate}</label><br><br>
       </li>
     </ul>
Index: extensions/NBC_UserAdvManager/trunk/admin/global.tpl
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 4997)
+++ extensions/NBC_UserAdvManager/trunk/admin/global.tpl	(revision 5056)
@@ -29,5 +29,5 @@
 </div>
 
-<form method="post" action="{$UserAdvManager_F_ACTION}" class="general">
+<form method="post" action="{$UAM_F_ACTION}" class="general">
 
 <p><input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} >&nbsp;<input class="submit" type="submit" value="{'audit'|@translate}" name="audit"></p>
@@ -39,5 +39,5 @@
 
   <div id="config1_header" class="instructionBlockHeaderCollapsed" onclick="nbc_blockToggleDisplay('config1_header', 'Config1')">
-    <span class="cluetip" title="{'UAM_restricTitle'|translate}|{'UAM_restricTitle_d'|translate}">{'UserAdvManager_Title1'|@translate}</span>
+    <span class="cluetip" title="{'UAM_restricTitle'|translate}|{'UAM_restricTitle_d'|translate}">{'UAM_Title1'|@translate}</span>
   </div>
 
@@ -45,44 +45,44 @@
   <fieldset>
     <ul>
-    	<li><label class="cluetip" title="{'UAM_casenTitle'|translate}|{'UAM_casenTitle_d'|translate}">{'UserAdvManager_No_Casse'|@translate}</label><br><br>
-        <input type="radio" value="false" {$UserAdvManager_NO_CASSE_FALSE} name="UserAdvManager_No_Casse">{'UserAdvManager_No_Casse_false'|@translate}<br>
-        <input type="radio" value="true" {$UserAdvManager_NO_CASSE_TRUE} name="UserAdvManager_No_Casse">{'UserAdvManager_No_Casse_true'|@translate}<br><br>
+    	<li><label class="cluetip" title="{'UAM_casenTitle'|translate}|{'UAM_casenTitle_d'|translate}">{'UAM_No_Casse'|@translate}</label><br><br>
+        <input type="radio" value="false" {$UAM_NO_CASSE_FALSE} name="UAM_No_Casse">{'UAM_No_Casse_false'|@translate}<br>
+        <input type="radio" value="true" {$UAM_NO_CASSE_TRUE} name="UAM_No_Casse">{'UAM_No_Casse_true'|@translate}<br><br>
    		</li>
       
-    	<li><label class="cluetip" title="{'UAM_carexcTitle'|translate}|{'UAM_carexcTitle_d'|translate}">{'UserAdvManager_Username_Char'|@translate}</label><br><br>
-        <input type="radio" value="false" {$UserAdvManager_USERNAME_CHAR_FALSE} name="UserAdvManager_Username_Char">{'UserAdvManager_Username_Char_false'|@translate}<br>
-        <input type="radio" value="true" {$UserAdvManager_USERNAME_CHAR_TRUE} name="UserAdvManager_Username_Char">{'UserAdvManager_Username_Char_true'|@translate}
-        <div id="uam_leftmargin"><input type="text" name="UserAdvManager_Username_List" value="{$UserAdvManager_USERNAME_CHAR_LIST}" size="20" style="text-align: center;"></div><br><br>
+    	<li><label class="cluetip" title="{'UAM_carexcTitle'|translate}|{'UAM_carexcTitle_d'|translate}">{'UAM_Username_Char'|@translate}</label><br><br>
+        <input type="radio" value="false" {$UAM_USERNAME_CHAR_FALSE} name="UAM_Username_Char">{'UAM_Username_Char_false'|@translate}<br>
+        <input type="radio" value="true" {$UAM_USERNAME_CHAR_TRUE} name="UAM_Username_Char">{'UAM_Username_Char_true'|@translate}
+        <div id="uam_leftmargin"><input type="text" name="UAM_Username_List" value="{$UAM_USERNAME_CHAR_LIST}" size="20" style="text-align: center;"></div><br><br>
     	</li>
       
-    	<li><label class="cluetip" title="{'UAM_passwTitle'|translate}|{'UAM_passwTitle_d'|translate}">{'UserAdvManager_Password_Enforced'|@translate}</label><br><br>
-        <input type="radio" value="false" {$UserAdvManager_PASSWORDENF_FALSE} name="UserAdvManager_Password_Enforced">{'UserAdvManager_Password_Enforced_false'|@translate}<br>
-        <input type="radio" value="true" {$UserAdvManager_PASSWORDENF_TRUE} name="UserAdvManager_Password_Enforced">{'UserAdvManager_Password_Enforced_true'|@translate}&nbsp;<input type="text" name="UserAdvManager_Password_Score" value="{$UserAdvManager_PASSWORD_SCORE}" size="5" style="text-align: center;"><br><br>
-
-        {'UserAdvManager_PasswordTest'|@translate}<input class="cluetip" title="{'UAM_passwtestTitle'|translate}|{'UAM_passwtestTitle_d'|translate}" type="text" name="UserAdvManager_Password_Test" value="{$UserAdvManager_PASSWORD_TEST}" size="50" style="text-align: left;">&nbsp;&nbsp;&nbsp;
+    	<li><label class="cluetip" title="{'UAM_passwTitle'|translate}|{'UAM_passwTitle_d'|translate}">{'UAM_Password_Enforced'|@translate}</label><br><br>
+        <input type="radio" value="false" {$UAM_PASSWORDENF_FALSE} name="UAM_Password_Enforced">{'UAM_Password_Enforced_false'|@translate}<br>
+        <input type="radio" value="true" {$UAM_PASSWORDENF_TRUE} name="UAM_Password_Enforced">{'UAM_Password_Enforced_true'|@translate}&nbsp;<input type="text" name="UAM_Password_Score" value="{$UAM_PASSWORD_SCORE}" size="5" style="text-align: center;"><br><br>
+
+        {'UAM_PasswordTest'|@translate}<input class="cluetip" title="{'UAM_passwtestTitle'|translate}|{'UAM_passwtestTitle_d'|translate}" type="text" name="UAM_Password_Test" value="{$UAM_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>
+        {'UAM_ScoreTest'|@translate}{$UAM_PASSWORD_TEST_SCORE}<br><br>
     	</li>
 
       <ul>
-      <li><label class="cluetip" title="{'UAM_passwadmTitle'|translate}|{'UAM_passwadmTitle_d'|translate}">{'UserAdvManager_AdminPassword_Enforced'|@translate}</label><br><br>
-        <input type="radio" value="false" {$UserAdvManager_ADMINPASSWENF_FALSE} name="UserAdvManager_AdminPassword_Enforced">{'UserAdvManager_AdminPassword_Enforced_false'|@translate}<br>        
-        <input type="radio" value="true" {$UserAdvManager_ADMINPASSWENF_TRUE} name="UserAdvManager_AdminPassword_Enforced">{'UserAdvManager_AdminPassword_Enforced_true'|@translate}<br><br>
+      <li><label class="cluetip" title="{'UAM_passwadmTitle'|translate}|{'UAM_passwadmTitle_d'|translate}">{'UAM_AdminPassword_Enforced'|@translate}</label><br><br>
+        <input type="radio" value="false" {$UAM_ADMINPASSWENF_FALSE} name="UAM_AdminPassword_Enforced">{'UAM_AdminPassword_Enforced_false'|@translate}<br>        
+        <input type="radio" value="true" {$UAM_ADMINPASSWENF_TRUE} name="UAM_AdminPassword_Enforced">{'UAM_AdminPassword_Enforced_true'|@translate}<br><br>
       </li>
       </ul>
       
-    	<li><label class="cluetip" title="{'UAM_mailexcTitle'|translate}|{'UAM_mailexcTitle_d'|translate}">{'UserAdvManager_MailExclusion'|@translate}</label><br><br>
-        <input type="radio" value="false" {$UserAdvManager_MAILEXCLUSION_FALSE} name="UserAdvManager_MailExclusion">{'UserAdvManager_MailExclusion_false'|@translate}<br>
-        <input type="radio" value="true" {$UserAdvManager_MAILEXCLUSION_TRUE} name="UserAdvManager_MailExclusion">{'UserAdvManager_MailExclusion_true'|@translate}<br><br>
+    	<li><label class="cluetip" title="{'UAM_mailexcTitle'|translate}|{'UAM_mailexcTitle_d'|translate}">{'UAM_MailExclusion'|@translate}</label><br><br>
+        <input type="radio" value="false" {$UAM_MAILEXCLUSION_FALSE} name="UAM_MailExclusion">{'UAM_MailExclusion_false'|@translate}<br>
+        <input type="radio" value="true" {$UAM_MAILEXCLUSION_TRUE} name="UAM_MailExclusion">{'UAM_MailExclusion_true'|@translate}<br><br>
     	</li>
 
-{if $UserAdvManager_MAILEXCLUSION_TRUE}
-  {if $UserAdvManager_ERROR_REPORTS4}     
-      <div id="uam_leftmargin"><textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea></div><br><br>
-  {else}
-      <div id="uam_leftmargin"><textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea></div><br><br>
-  {/if}
-{else}
-      <div id="uam_leftmargin"><textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea></div><br><br>
+{if $UAM_MAILEXCLUSION_TRUE}
+  {if $UAM_ERROR_REPORTS4}     
+      <div id="uam_leftmargin"><textarea name="UAM_MailExclusion_List" id="UAM_MailExclusion_List" rows="3" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UAM_MAILEXCLUSION_LIST}</textarea></div><br><br>
+  {else}
+      <div id="uam_leftmargin"><textarea name="UAM_MailExclusion_List" id="UAM_MailExclusion_List" rows="3" cols="80" {$TAG_INPUT_ENABLED}>{$UAM_MAILEXCLUSION_LIST}</textarea></div><br><br>
+  {/if}
+{else}
+      <div id="uam_leftmargin"><textarea name="UAM_MailExclusion_List" id="UAM_MailExclusion_List" rows="3" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UAM_MAILEXCLUSION_LIST}</textarea></div><br><br>
 {/if}
     </ul>
@@ -97,5 +97,5 @@
     
   <div id="config2_header" class="instructionBlockHeaderCollapsed" onclick="nbc_blockToggleDisplay('config2_header', 'Config2')">
-    <span class="cluetip" title="{'UAM_confirmTitle'|translate}|{'UAM_confirmTitle_d'|translate}">{'UserAdvManager_Title2'|@translate}</span>
+    <span class="cluetip" title="{'UAM_confirmTitle'|translate}|{'UAM_confirmTitle_d'|translate}">{'UAM_Title2'|@translate}</span>
   </div>
   
@@ -103,58 +103,58 @@
     <fieldset>
       <ul>
-      	<li><label class="cluetip" title="{'UAM_infomailTitle'|translate}|{'UAM_infomailTitle_d'|translate}">{'UserAdvManager_Mail_Info'|@translate}</label><br><br>
-          <input type="radio" value="false" {$UserAdvManager_MAIL_INFO_FALSE} name="UserAdvManager_Mail_Info">{'UserAdvManager_Mail_Info_false'|@translate}<br>
-          <input type="radio" value="true" {$UserAdvManager_MAIL_INFO_TRUE} name="UserAdvManager_Mail_Info">{'UserAdvManager_Mail_Info_true'|@translate}<br><br>
+      	<li><label class="cluetip" title="{'UAM_infomailTitle'|translate}|{'UAM_infomailTitle_d'|translate}">{'UAM_Mail_Info'|@translate}</label><br><br>
+          <input type="radio" value="false" {$UAM_MAIL_INFO_FALSE} name="UAM_Mail_Info">{'UAM_Mail_Info_false'|@translate}<br>
+          <input type="radio" value="true" {$UAM_MAIL_INFO_TRUE} name="UAM_Mail_Info">{'UAM_Mail_Info_true'|@translate}<br><br>
       	</li>
         <ul>
-{if $UserAdvManager_MAIL_INFO_TRUE}
-  {if $UserAdvManager_ERROR_REPORTS1}      
-          <li><label class="cluetip" title="{'UAM_infotxtTitle'|translate}|{'UAM_infotxtTitle_d'|translate}">{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
-            <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" style="color: red"  {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br>
-          </li>
-  {else}
-          <li><label class="cluetip" title="{'UAM_infotxtTitle'|translate}|{'UAM_infotxtTitle_d'|translate}">{'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}
-{else}
-          <li><label class="cluetip" title="{'UAM_infotxtTitle'|translate}|{'UAM_infotxtTitle_d'|translate}">{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
-            <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br>
-          </li>
-{/if}
-<!--
-{if 'FCK_PATH'|@defined}
-  <div style="text-align:right;">
-    <a href="#" onClick="toogleEditor('UserAdvManager_MailInfo_Text'); return false;">FCK Editor On/Off</a>
-  </div>
-{/if}
--->
-        </ul>
-
-      	<li><label class="cluetip" title="{'UAM_confirmmailTitle'|translate}|{'UAM_confirmmailTitle_d'|translate}">{'UserAdvManager_Confirm_Mail'|@translate}</label><br><br>
-          <input type="radio" value="false" {$UserAdvManager_CONFIRM_MAIL_FALSE} name="UserAdvManager_Confirm_Mail">{'UserAdvManager_Confirm_Mail_false'|@translate}<br>
-          <input type="radio" value="true" {$UserAdvManager_CONFIRM_MAIL_TRUE} name="UserAdvManager_Confirm_Mail">{'UserAdvManager_Confirm_Mail_true'|@translate}<br><br>
+{if $UAM_MAIL_INFO_TRUE}
+  {if $UAM_ERROR_REPORTS1}      
+          <li><label class="cluetip" title="{'UAM_infotxtTitle'|translate}|{'UAM_infotxtTitle_d'|translate}">{'UAM_MailInfo_Text'|@translate}</label><br><br>
+            <textarea name="UAM_MailInfo_Text" id="UAM_MailInfo_Text" rows="10" cols="80" style="color: red"  {$TAG_INPUT_ENABLED}>{$UAM_MAILINFO_TEXT}</textarea><br><br>
+          </li>
+  {else}
+          <li><label class="cluetip" title="{'UAM_infotxtTitle'|translate}|{'UAM_infotxtTitle_d'|translate}">{'UAM_MailInfo_Text'|@translate}</label><br><br>
+            <textarea name="UAM_MailInfo_Text" id="UAM_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UAM_MAILINFO_TEXT}</textarea><br><br>
+          </li>
+  {/if}
+{else}
+          <li><label class="cluetip" title="{'UAM_infotxtTitle'|translate}|{'UAM_infotxtTitle_d'|translate}">{'UAM_MailInfo_Text'|@translate}</label><br><br>
+            <textarea name="UAM_MailInfo_Text" id="UAM_MailInfo_Text" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UAM_MAILINFO_TEXT}</textarea><br><br>
+          </li>
+{/if}
+<!--
+{if 'FCK_PATH'|@defined}
+  <div style="text-align:right;">
+    <a href="#" onClick="toogleEditor('UAM_MailInfo_Text'); return false;">FCK Editor On/Off</a>
+  </div>
+{/if}
+-->
+        </ul>
+
+      	<li><label class="cluetip" title="{'UAM_confirmmailTitle'|translate}|{'UAM_confirmmailTitle_d'|translate}">{'UAM_Confirm_Mail'|@translate}</label><br><br>
+          <input type="radio" value="false" {$UAM_CONFIRM_MAIL_FALSE} name="UAM_Confirm_Mail">{'UAM_Confirm_Mail_false'|@translate}<br>
+          <input type="radio" value="true" {$UAM_CONFIRM_MAIL_TRUE} name="UAM_Confirm_Mail">{'UAM_Confirm_Mail_true'|@translate}<br><br>
       	</li>
 
         <ul>
-{if $UserAdvManager_CONFIRM_MAIL_TRUE}
-  {if $UserAdvManager_ERROR_REPORTS2}     
-          <li><label class="cluetip" title="{'UAM_confirmtxtTitle'|translate}|{'UAM_confirmtxtTitle_d'|translate}">{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br>
-            <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br>
-          </li>
-  {else}
-          <li><label class="cluetip" title="{'UAM_confirmtxtTitle'|translate}|{'UAM_confirmtxtTitle_d'|translate}">{'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}
-{else}
-          <li><label class="cluetip" title="{'UAM_confirmtxtTitle'|translate}|{'UAM_confirmtxtTitle_d'|translate}">{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br>
-            <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br>
-          </li>
-{/if}
-<!--
-{if 'FCK_PATH'|@defined}
-  <div style="text-align:right;">
-    <a href="#" onClick="toogleEditor('UserAdvManager_ConfirmMail_Text'); return false;">FCK Editor On/Off</a>
+{if $UAM_CONFIRM_MAIL_TRUE}
+  {if $UAM_ERROR_REPORTS2}     
+          <li><label class="cluetip" title="{'UAM_confirmtxtTitle'|translate}|{'UAM_confirmtxtTitle_d'|translate}">{'UAM_ConfirmMail_Text'|@translate}</label><br><br>
+            <textarea name="UAM_ConfirmMail_Text" id="UAM_ConfirmMail_Text" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_TEXT}</textarea><br><br>
+          </li>
+  {else}
+          <li><label class="cluetip" title="{'UAM_confirmtxtTitle'|translate}|{'UAM_confirmtxtTitle_d'|translate}">{'UAM_ConfirmMail_Text'|@translate}</label><br><br>
+            <textarea name="UAM_ConfirmMail_Text" id="UAM_ConfirmMail_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_TEXT}</textarea><br><br>
+          </li>
+  {/if}
+{else}
+          <li><label class="cluetip" title="{'UAM_confirmtxtTitle'|translate}|{'UAM_confirmtxtTitle_d'|translate}">{'UAM_ConfirmMail_Text'|@translate}</label><br><br>
+            <textarea name="UAM_ConfirmMail_Text" id="UAM_ConfirmMail_Text" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_TEXT}</textarea><br><br>
+          </li>
+{/if}
+<!--
+{if 'FCK_PATH'|@defined}
+  <div style="text-align:right;">
+    <a href="#" onClick="toogleEditor('UAM_ConfirmMail_Text'); return false;">FCK Editor On/Off</a>
   </div>
 {/if}
@@ -164,33 +164,33 @@
         <br><hr><br>
         
-        <div id="uam_notice">{'UserAdvManager_Confirm_grpstat_notice'|@translate}</div>
+        <div id="uam_notice">{'UAM_Confirm_grpstat_notice'|@translate}</div>
         
         <br>
         
         <li>
-          <label class="cluetip" title="{'UAM_confirmgrpTitle'|translate}|{'UAM_confirmgrpTitle_d'|translate}">{'UserAdvManager_Confirm_Group'|@translate}</label><br><br>
-        </li>
-
-        <ul>
-          <li><label>{'UserAdvManager_No_Confirm_Group'|@translate}</label><br>
-            <div id="uam_leftmargin">{html_options name="UserAdvManager_No_Confirm_Group" options=$No_Confirm_Group.group_options selected=$No_Confirm_Group.group_selected}</div><br><br>
+          <label class="cluetip" title="{'UAM_confirmgrpTitle'|translate}|{'UAM_confirmgrpTitle_d'|translate}">{'UAM_Confirm_Group'|@translate}</label><br><br>
+        </li>
+
+        <ul>
+          <li><label>{'UAM_No_Confirm_Group'|@translate}</label><br>
+            <div id="uam_leftmargin">{html_options name="UAM_No_Confirm_Group" options=$No_Confirm_Group.group_options selected=$No_Confirm_Group.group_selected}</div><br><br>
           </li>
       
-          <li><label>{'UserAdvManager_Validated_Group'|@translate}</label><br>
-            <div id="uam_leftmargin">{html_options name="UserAdvManager_Validated_Group" options=$Validated_Group.group_options selected=$Validated_Group.group_selected}</div><br><br>
+          <li><label>{'UAM_Validated_Group'|@translate}</label><br>
+            <div id="uam_leftmargin">{html_options name="UAM_Validated_Group" options=$Validated_Group.group_options selected=$Validated_Group.group_selected}</div><br><br>
           </li>
         </ul>
 
         <li>
-          <label class="cluetip" title="{'UAM_confirmstatTitle'|translate}|{'UAM_confirmstatTitle_d'|translate}">{'UserAdvManager_Confirm_Status'|@translate}</label><br><br>
-        </li>
-
-        <ul>
-          <li><label>{'UserAdvManager_No_Confirm_Status'|@translate}</label><br>
-            <div id="uam_leftmargin">{html_options name="UserAdvManager_No_Confirm_Status" options=$No_Confirm_Status.Status_options selected=$No_Confirm_Status.Status_selected}</div><br><br>
-          </li>
-
-          <li><label>{'UserAdvManager_Validated_Status'|@translate}</label><br>
-            <div id="uam_leftmargin">{html_options name="UserAdvManager_Validated_Status" options=$Confirm_Status.Status_options selected=$Confirm_Status.Status_selected}</div><br><br>
+          <label class="cluetip" title="{'UAM_confirmstatTitle'|translate}|{'UAM_confirmstatTitle_d'|translate}">{'UAM_Confirm_Status'|@translate}</label><br><br>
+        </li>
+
+        <ul>
+          <li><label>{'UAM_No_Confirm_Status'|@translate}</label><br>
+            <div id="uam_leftmargin">{html_options name="UAM_No_Confirm_Status" options=$No_Confirm_Status.Status_options selected=$No_Confirm_Status.Status_selected}</div><br><br>
+          </li>
+
+          <li><label>{'UAM_Validated_Status'|@translate}</label><br>
+            <div id="uam_leftmargin">{html_options name="UAM_Validated_Status" options=$Confirm_Status.Status_options selected=$Confirm_Status.Status_selected}</div><br><br>
           </li>
         </ul>
@@ -198,57 +198,57 @@
         <br><hr><br>
 
-        <li><label class="cluetip" title="{'UAM_validationlimitTitle'|translate}|{'UAM_validationlimitTitle_d'|translate}">{'UserAdvManager_ValidationLimit_Info'|@translate}</label><br><br>
-          <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_TIMEOUT_FALSE} name="UserAdvManager_ConfirmMail_TimeOut"> {'UserAdvManager_ConfirmMail_TimeOut_false'|@translate}<br>
-          <input type="radio" value="true" {$UserAdvManager_CONFIRMMAIL_TIMEOUT_TRUE} name="UserAdvManager_ConfirmMail_TimeOut"> {'UserAdvManager_ConfirmMail_TimeOut_true'|@translate}<input type="text" name="UserAdvManager_ConfirmMail_Delay" value="{$UserAdvManager_CONFIRMMAIL_DELAY}" size="5" style="text-align: center;"><br><br>
+        <li><label class="cluetip" title="{'UAM_validationlimitTitle'|translate}|{'UAM_validationlimitTitle_d'|translate}">{'UAM_ValidationLimit_Info'|@translate}</label><br><br>
+          <input type="radio" value="false" {$UAM_CONFIRMMAIL_TIMEOUT_FALSE} name="UAM_ConfirmMail_TimeOut"> {'UAM_ConfirmMail_TimeOut_false'|@translate}<br>
+          <input type="radio" value="true" {$UAM_CONFIRMMAIL_TIMEOUT_TRUE} name="UAM_ConfirmMail_TimeOut"> {'UAM_ConfirmMail_TimeOut_true'|@translate}<input type="text" name="UAM_ConfirmMail_Delay" value="{$UAM_CONFIRMMAIL_DELAY}" size="5" style="text-align: center;"><br><br>
         </li>
     
-        <li><label class="cluetip" title="{'UAM_remailTitle'|translate}|{'UAM_remailTitle_d'|translate}">{'UserAdvManager_ConfirmMail_Remail'|@translate}</label><br><br>
-          <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_REMAIL_FALSE} name="UserAdvManager_ConfirmMail_Remail"> {'UserAdvManager_ConfirmMail_Remail_false'|@translate}<br>
-          <input type="radio" value="true" {$UserAdvManager_CONFIRMMAIL_REMAIL_TRUE} name="UserAdvManager_ConfirmMail_Remail"> {'UserAdvManager_ConfirmMail_Remail_true'|@translate}<br><br>
-        </li>
-
-        <ul>
-{if $UserAdvManager_CONFIRMMAIL_REMAIL_TRUE}
-  {if $UserAdvManager_ERROR_REPORTS1}
-        <li><label class="cluetip" title="{'UAM_remailtxt1Title'|translate}|{'UAM_remailtxt1Title_d'|translate}">{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br><br>
-          <textarea name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
-        </li>
-  {else}
-        <li><label class="cluetip" title="{'UAM_remailtxt1Title'|translate}|{'UAM_remailtxt1Title_d'|translate}">{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><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>
-  {/if}
-{else}
-        <li><label class="cluetip" title="{'UAM_remailtxt1Title'|translate}|{'UAM_remailtxt1Title_d'|translate}">{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><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>
-{/if}
-<!--
-{if 'FCK_PATH'|@defined}
-  <div style="text-align:right;">
-    <a href="#" onClick="toogleEditor('UserAdvManager_ConfirmMail_ReMail_Txt1'); return false;">FCK Editor On/Off</a>
-  </div>
-{/if}
--->
-
-{if $UserAdvManager_CONFIRMMAIL_REMAIL_TRUE}
-  {if $UserAdvManager_ERROR_REPORTS2}
-        <li><label class="cluetip" title="{'UAM_remailtxt2Title'|translate}|{'UAM_remailtxt2Title_d'|translate}">{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br><br>
-          <textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
+        <li><label class="cluetip" title="{'UAM_remailTitle'|translate}|{'UAM_remailTitle_d'|translate}">{'UAM_ConfirmMail_Remail'|@translate}</label><br><br>
+          <input type="radio" value="false" {$UAM_CONFIRMMAIL_REMAIL_FALSE} name="UAM_ConfirmMail_Remail"> {'UAM_ConfirmMail_Remail_false'|@translate}<br>
+          <input type="radio" value="true" {$UAM_CONFIRMMAIL_REMAIL_TRUE} name="UAM_ConfirmMail_Remail"> {'UAM_ConfirmMail_Remail_true'|@translate}<br><br>
+        </li>
+
+        <ul>
+{if $UAM_CONFIRMMAIL_REMAIL_TRUE}
+  {if $UAM_ERROR_REPORTS1}
+        <li><label class="cluetip" title="{'UAM_remailtxt1Title'|translate}|{'UAM_remailtxt1Title_d'|translate}">{'UAM_ConfirmMail_ReMail_Txt1'|@translate}</label><br><br>
+          <textarea name="UAM_ConfirmMail_ReMail_Txt1" id="UAM_ConfirmMail_ReMail_Txt1" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
+        </li>
+  {else}
+        <li><label class="cluetip" title="{'UAM_remailtxt1Title'|translate}|{'UAM_remailtxt1Title_d'|translate}">{'UAM_ConfirmMail_ReMail_Txt1'|@translate}</label><br><br>
+          <textarea name="UAM_ConfirmMail_ReMail_Txt1" id="UAM_ConfirmMail_ReMail_Txt1" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
+        </li>
+  {/if}
+{else}
+        <li><label class="cluetip" title="{'UAM_remailtxt1Title'|translate}|{'UAM_remailtxt1Title_d'|translate}">{'UAM_ConfirmMail_ReMail_Txt1'|@translate}</label><br><br>
+          <textarea  name="UAM_ConfirmMail_ReMail_Txt1" id="UAM_ConfirmMail_ReMail_Txt1" rows="10" cols="80" readonly{$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
+        </li>
+{/if}
+<!--
+{if 'FCK_PATH'|@defined}
+  <div style="text-align:right;">
+    <a href="#" onClick="toogleEditor('UAM_ConfirmMail_ReMail_Txt1'); return false;">FCK Editor On/Off</a>
+  </div>
+{/if}
+-->
+
+{if $UAM_CONFIRMMAIL_REMAIL_TRUE}
+  {if $UAM_ERROR_REPORTS2}
+        <li><label class="cluetip" title="{'UAM_remailtxt2Title'|translate}|{'UAM_remailtxt2Title_d'|translate}">{'UAM_ConfirmMail_ReMail_Txt2'|@translate}</label><br><br>
+          <textarea name="UAM_ConfirmMail_ReMail_Txt2" id="UAM_ConfirmMail_ReMail_Txt2" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
         </li>
   {else}		
-        <li><label class="cluetip" title="{'UAM_remailtxt2Title'|translate}|{'UAM_remailtxt2Title_d'|translate}">{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br><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>
-  {/if}
-{else}
-        <li><label class="cluetip" title="{'UAM_remailtxt2Title'|translate}|{'UAM_remailtxt2Title_d'|translate}">{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br><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><br>
-        </li>
-{/if}
-<!--
-{if 'FCK_PATH'|@defined}
-  <div style="text-align:right;">
-    <a href="#" onClick="toogleEditor('UserAdvManager_ConfirmMail_ReMail_Txt2'); return false;">FCK Editor On/Off</a>
+        <li><label class="cluetip" title="{'UAM_remailtxt2Title'|translate}|{'UAM_remailtxt2Title_d'|translate}">{'UAM_ConfirmMail_ReMail_Txt2'|@translate}</label><br><br>
+          <textarea name="UAM_ConfirmMail_ReMail_Txt2" id="UAM_ConfirmMail_ReMail_Txt2" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
+        </li>
+  {/if}
+{else}
+        <li><label class="cluetip" title="{'UAM_remailtxt2Title'|translate}|{'UAM_remailtxt2Title_d'|translate}">{'UAM_ConfirmMail_ReMail_Txt2'|@translate}</label><br><br>
+          <textarea name="UAM_ConfirmMail_ReMail_Txt2" id="UAM_ConfirmMail_ReMail_Txt2" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT2}</textarea><br><br>
+        </li>
+{/if}
+<!--
+{if 'FCK_PATH'|@defined}
+  <div style="text-align:right;">
+    <a href="#" onClick="toogleEditor('UAM_ConfirmMail_ReMail_Txt2'); return false;">FCK Editor On/Off</a>
   </div>
 {/if}
@@ -264,5 +264,5 @@
 
   <div id="config3_header" class="instructionBlockHeaderCollapsed" onclick="nbc_blockToggleDisplay('config3_header', 'Config3')">
-    <span class="cluetip" title="{'UAM_miscTitle'|translate}|{'UAM_miscTitle_d'|translate}">{'UserAdvManager_Title3'|@translate}</span>
+    <span class="cluetip" title="{'UAM_miscTitle'|translate}|{'UAM_miscTitle_d'|translate}">{'UAM_Title3'|@translate}</span>
   </div>
   
@@ -270,29 +270,29 @@
     <fieldset>
       <ul>
-        <li><label class="cluetip" title="{'UAM_ghosttrackerTitle'|translate}|{'UAM_ghosttrackerTitle_d'|translate}">{'UserAdvManager_GhostTracker'|@translate}</label><br><br>
-          <input type="radio" value="false" {$UserAdvManager_GHOSTRACKER_FALSE} name="UserAdvManager_GhostUser_Tracker">{'UserAdvManager_GhostTracker_false'|@translate}<br>
-          <input type="radio" value="true" {$UserAdvManager_GHOSTRACKER_TRUE} name="UserAdvManager_GhostUser_Tracker">{'UserAdvManager_GhostTracker_true'|@translate}<input type="text" name="UserAdvManager_GhostTracker_DayLimit" value="{$UserAdvManager_GHOSTRACKER_DAYLIMIT}" size="5" style="text-align: center;"><br><br>
+        <li><label class="cluetip" title="{'UAM_ghosttrackerTitle'|translate}|{'UAM_ghosttrackerTitle_d'|translate}">{'UAM_GhostTracker'|@translate}</label><br><br>
+          <input type="radio" value="false" {$UAM_GHOSTRACKER_FALSE} name="UAM_GhostUser_Tracker">{'UAM_GhostTracker_false'|@translate}<br>
+          <input type="radio" value="true" {$UAM_GHOSTRACKER_TRUE} name="UAM_GhostUser_Tracker">{'UAM_GhostTracker_true'|@translate}<input type="text" name="UAM_GhostTracker_DayLimit" value="{$UAM_GHOSTRACKER_DAYLIMIT}" size="5" style="text-align: center;"><br><br>
         </li>
         
         <ul>
-{if $UserAdvManager_GHOSTRACKER_TRUE}
-  {if $UserAdvManager_ERROR_REPORTS3}
-          <li><label class="cluetip" title="{'UAM_gttextTitle'|translate}|{'UAM_gttextTitle_d'|translate}">{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br>
-            <textarea name="UserAdvManager_GhostTracker_ReminderText" id="UserAdvManager_GhostTracker_ReminderText" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_GHOSTRACKER_REMINDERTEXT}</textarea><br><br>
-          </li>
-  {else}
-          <li><label class="cluetip" title="{'UAM_gttextTitle'|translate}|{'UAM_gttextTitle_d'|translate}">{'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}
-{else}
-          <li><label class="cluetip" title="{'UAM_gttextTitle'|translate}|{'UAM_gttextTitle_d'|translate}">{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br>
-            <textarea name="UserAdvManager_GhostTracker_ReminderText" id="UserAdvManager_GhostTracker_ReminderText" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UserAdvManager_GHOSTRACKER_REMINDERTEXT}</textarea><br><br>
-          </li>
-{/if}
-<!--
-{if 'FCK_PATH'|@defined}
-  <div style="text-align:right;">
-    <a href="#" onClick="toogleEditor('UserAdvManager_GhostTracker_ReminderText'); return false;">FCK Editor On/Off</a>
+{if $UAM_GHOSTRACKER_TRUE}
+  {if $UAM_ERROR_REPORTS3}
+          <li><label class="cluetip" title="{'UAM_gttextTitle'|translate}|{'UAM_gttextTitle_d'|translate}">{'UAM_GhostTracker_ReminderText'|@translate}</label><br><br>
+            <textarea name="UAM_GhostTracker_ReminderText" id="UAM_GhostTracker_ReminderText" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UAM_GHOSTRACKER_REMINDERTEXT}</textarea><br><br>
+          </li>
+  {else}
+          <li><label class="cluetip" title="{'UAM_gttextTitle'|translate}|{'UAM_gttextTitle_d'|translate}">{'UAM_GhostTracker_ReminderText'|@translate}</label><br><br>
+            <textarea name="UAM_GhostTracker_ReminderText" id="UAM_GhostTracker_ReminderText" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UAM_GHOSTRACKER_REMINDERTEXT}</textarea><br><br>
+          </li>
+  {/if}
+{else}
+          <li><label class="cluetip" title="{'UAM_gttextTitle'|translate}|{'UAM_gttextTitle_d'|translate}">{'UAM_GhostTracker_ReminderText'|@translate}</label><br><br>
+            <textarea name="UAM_GhostTracker_ReminderText" id="UAM_GhostTracker_ReminderText" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UAM_GHOSTRACKER_REMINDERTEXT}</textarea><br><br>
+          </li>
+{/if}
+<!--
+{if 'FCK_PATH'|@defined}
+  <div style="text-align:right;">
+    <a href="#" onClick="toogleEditor('UAM_GhostTracker_ReminderText'); return false;">FCK Editor On/Off</a>
   </div>
 {/if}
@@ -300,12 +300,12 @@
         </ul>
     
-        <li><label class="cluetip" title="{'UAM_lastvisitTitle'|translate}|{'UAM_lastvisitTitle_d'|translate}">{'UserAdvManager_LastVisit'|@translate}</label><br><br>
-          <input type="radio" value="false" {$UserAdvManager_ADDLASTVISIT_FALSE} name="UserAdvManager_Add_LastVisit_Column">{'UserAdvManager_LastVisit_false'|@translate}<br>
-          <input type="radio" value="true" {$UserAdvManager_ADDLASTVISIT_TRUE} name="UserAdvManager_Add_LastVisit_Column">{'UserAdvManager_LastVisit_true'|@translate}<br><br>
-        </li>
-
-        <li><label class="cluetip" title="{'UAM_commentTitle'|translate}|{'UAM_commentTitle_d'|translate}">{'UserAdvManager_No_Comment_Anonymous'|@translate}</label><br><br>
-          <input type="radio" value="false" {$UserAdvManager_NO_COMMENT_ANO_FALSE} name="UserAdvManager_No_Comment_Anonymous">{'UserAdvManager_No_Comment_Anonymous_false'|@translate}<br>
-          <input type="radio" value="true" {$UserAdvManager_NO_COMMENT_ANO_TRUE} name="UserAdvManager_No_Comment_Anonymous">{'UserAdvManager_No_Comment_Anonymous_true'|@translate}<br><br>
+        <li><label class="cluetip" title="{'UAM_lastvisitTitle'|translate}|{'UAM_lastvisitTitle_d'|translate}">{'UAM_LastVisit'|@translate}</label><br><br>
+          <input type="radio" value="false" {$UAM_ADDLASTVISIT_FALSE} name="UAM_Add_LastVisit_Column">{'UAM_LastVisit_false'|@translate}<br>
+          <input type="radio" value="true" {$UAM_ADDLASTVISIT_TRUE} name="UAM_Add_LastVisit_Column">{'UAM_LastVisit_true'|@translate}<br><br>
+        </li>
+
+        <li><label class="cluetip" title="{'UAM_commentTitle'|translate}|{'UAM_commentTitle_d'|translate}">{'UAM_No_Comment_Anonymous'|@translate}</label><br><br>
+          <input type="radio" value="false" {$UAM_NO_COMMENT_ANO_FALSE} name="UAM_No_Comment_Anonymous">{'UAM_No_Comment_Anonymous_false'|@translate}<br>
+          <input type="radio" value="true" {$UAM_NO_COMMENT_ANO_TRUE} name="UAM_No_Comment_Anonymous">{'UAM_No_Comment_Anonymous_true'|@translate}<br><br>
         </li>
       </ul>
@@ -319,5 +319,5 @@
     
   <div id="Tips_header" class="instructionBlockHeaderCollapsed" onclick="nbc_blockToggleDisplay('Tips_header', 'Tips')">
-    <span class="cluetip" title="{'UAM_tipsTitle'|translate}|{'UAM_tipsTitle_d'|translate}">{'UserAdvManager_Title4'|@translate}</span>
+    <span class="cluetip" title="{'UAM_tipsTitle'|translate}|{'UAM_tipsTitle_d'|translate}">{'UAM_Title4'|@translate}</span>
   </div>
   
@@ -325,9 +325,9 @@
     <fieldset>
       <div id="Tips1_header" class="instructionBlockHeaderCollapsed" onclick="nbc_blockToggleDisplay('Tips1_header', 'Tips1')">
-        <span>{'UserAdvManager_Tips1'|@translate}</span>
+        <span>{'UAM_Tips1'|@translate}</span>
       </div>
       <div id="Tips1" class="instructionBlockContent" style="display:none">
         <fieldset>
-          {'UserAdvManager_Tips1_txt'|@translate}
+          {'UAM_Tips1_txt'|@translate}
         </fieldset>
       </div>
Index: extensions/NBC_UserAdvManager/trunk/admin/userlist.tpl
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/userlist.tpl	(revision 4997)
+++ extensions/NBC_UserAdvManager/trunk/admin/userlist.tpl	(revision 5056)
@@ -17,5 +17,5 @@
 </div>
 
-<form method="post" action="{$UserAdvManager_F_ACTION}" class="general">
+<form method="post" action="{$UAM_F_ACTION}" class="general">
   <fieldset>
   	<legend class="cluetip" title="{'UAM_userlistTitle'|translate}|{'UAM_userlistTitle_d'|translate}">{'UserList_Title'|@translate}</legend>
Index: extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl	(revision 4997)
+++ extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl	(revision 5056)
@@ -17,5 +17,5 @@
 </div>
 
-<form method="post" action="{$UserAdvManager_F_ACTION}" class="general">
+<form method="post" action="{$UAM_F_ACTION}" class="general">
   <fieldset>
   	<legend class="cluetip" title="{'UAM_usermanTitle'|translate}|{'UAM_usermanTitle_d'|translate}">{'UserManager_Title'|@translate}</legend>
