Index: /extensions/NBC_UserAdvManager/branches/2.12/ConfirmMail.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/ConfirmMail.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/ConfirmMail.php	(revision 4144)
@@ -0,0 +1,77 @@
+<?php
+//----------------------------------------------------------- include
+define('PHPWG_ROOT_PATH','./../../');
+include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
+include_once (NBC_UserAdvManager_PATH.'include/constants.php');
+include_once (NBC_UserAdvManager_PATH.'include/functions_UserAdvManager.inc.php');
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+//check_status(ACCESS_NONE);
+load_language('plugin.lang', NBC_UserAdvManager_PATH);
+
+if (isset($_GET['key']))
+{
+
+  if (VerifyConfirmMail($_GET['key']))
+    $template->assign(
+			array(
+				'CONFIRM_MAIL_MESSAGE' => l10n('confirm_mail_ok'),
+			)
+		);
+  else  
+    $template->assign(
+			array(
+				'CONFIRM_MAIL_MESSAGE' => l10n('confirm_mail_bad'),
+			)
+		);        
+//    redirect(make_index_url());
+}
+
+/**
+ * set in ./language/en_UK.iso-8859-1/local.lang.php (maybe to create)
+ * for example for clear theme:
+  $lang['Theme: clear'] = 'This is the clear theme based on yoga template. '.
+  ' A standard template/theme of PhpWebgallery.';
+ *
+ * Don't forget php tags !!!
+ *
+ * Another way is to code it thru the theme itself in ./themeconf.inc.php
+ */
+
+$title= l10n('confirm_mail_page_title');
+$page['body_id'] = 'theAboutPage';
+include(PHPWG_ROOT_PATH.'include/page_header.php');
+
+@include(PHPWG_ROOT_PATH.'template/'.$user['template'].
+  '/theme/'.$user['theme'].'/themeconf.inc.php');
+
+/* $template->set_filenames(array('confirm_mail' => realpath(NBC_UserAdvManager_PATH . 'ConfirmMail.tpl')));*/
+$template->set_filenames(
+  array(
+  	'confirm_mail'=>NBC_UserAdvManager_PATH.'ConfirmMail.tpl',
+	)
+);
+if ( isset($lang['Theme: '.$user['theme']]) )
+{
+  $template->assign(
+  	'THEME_ABOUT',l10n('Theme: '.$user['theme'])
+  );
+}
+
+if ( isset($conf['gallery_url']) )
+	{
+	$template->assign(
+		array(
+    	'GALLERY_URL' =>
+      		isset($page['gallery_url']) ?
+          		$page['gallery_url'] : $conf['gallery_url'],
+		)
+	);
+}
+
+
+$template->pparse('confirm_mail');
+include(PHPWG_ROOT_PATH.'include/page_tail.php');
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/ConfirmMail.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/ConfirmMail.tpl	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/ConfirmMail.tpl	(revision 4144)
@@ -0,0 +1,22 @@
+{* $Id: ConfirmMail.tpl $ *}
+<div id="content" class="content">
+  <div class="titrePage">
+    <ul class="categoryActions">
+      <li>
+      {if isset($GALLERY_URL) }
+        <a href="{$GALLERY_URL}" title="{'return to homepage'|@translate}">
+          <img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/>
+        </a>
+      {else}
+        <a href="{$U_HOME}" title="{'return to homepage'|@translate}">
+          <img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/>
+        </a>
+      {/if}
+      </li>
+    </ul>
+    <h2>{'title_confirm_mail'|@translate}</h2>
+  </div>
+  <ul>
+  {$CONFIRM_MAIL_MESSAGE}
+  </ul>
+</div>
Index: /extensions/NBC_UserAdvManager/branches/2.12/admin/UserAdvManager_admin.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/admin/UserAdvManager_admin.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/admin/UserAdvManager_admin.php	(revision 4144)
@@ -0,0 +1,1243 @@
+<?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);
+
+//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_UserAdvManager_PATH);
+
+// +-----------------------------------------------------------------------+
+// |                            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('confirmmail',
+               l10n('Tab_ConfirmMail'),
+               $my_base_url.'&amp;tab=confirmmail');
+$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();
+
+$page['global'] = array();
+$error = array();
+$UserAdvManager_Password_Test_Score = 0;
+
+// +-----------------------------------------------------------------------+
+// |                            Tabssheet select                           |
+// +-----------------------------------------------------------------------+
+
+switch ($page['tab'])
+{
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                           Global Config                               |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'global':
+	
+	if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) and isset($_POST['UserAdvManager_Password_Enforced']) and isset($_POST['UserAdvManager_AdminPassword_Enforced']) and isset($_POST['UserAdvManager_GhostUser_Tracker']))
+  {
+		$_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text']));
+		$_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text']));
+
+  $_POST['UserAdvManager_GhostTracker_ReminderText'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_GhostTracker_ReminderText']));
+		
+		$newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'].';'.$_POST['UserAdvManager_AdminPassword_Enforced'].';'.$_POST['UserAdvManager_GhostUser_Tracker'].';'.$_POST['UserAdvManager_GhostTracker_DayLimit'].';'.$_POST['UserAdvManager_GhostTracker_ReminderText'];
+		
+		$conf['nbc_UserAdvManager'] = $newconf_nbc_UserAdvManager;
+		
+		$query = '
+	  	UPDATE '.CONFIG_TABLE.'
+	  	SET value="'.$newconf_nbc_UserAdvManager.'"
+	  	WHERE param="nbc_UserAdvManager"
+	  	LIMIT 1
+	  	;';
+		
+		pwg_query($query);
+		
+		array_push($page['infos'], l10n('UserAdvManager_save_config'));
+  }
+
+  if (isset($_POST['PasswordTest']) and !is_adviser() and isset($_POST['UserAdvManager_Password_Test']) and !empty($_POST['UserAdvManager_Password_Test']))
+  {
+    $UserAdvManager_Password_Test_Score = testpassword($_POST['UserAdvManager_Password_Test']);
+  }
+  else if (isset($_POST['PasswordTest']) and !is_adviser() and empty($_POST['UserAdvManager_Password_Test']))
+  {
+    array_push($page['errors'], l10n('reg_err_login3'));
+  }
+	
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+	
+/* 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_array($result))
+  {
+    $groups[$row['id']] = $row['name'];
+/* configuration value for unvalidated users */
+    if (isset($conf_nbc_UserAdvManager[3]) and $conf_nbc_UserAdvManager[3] == $row['id'])
+    {
+	  	$No_Valid = $row['id'];
+		}
+/* configuration value for validated users */
+    if (isset($conf_nbc_UserAdvManager[4]) and $conf_nbc_UserAdvManager[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_nbc_UserAdvManager[9]) and $conf_nbc_UserAdvManager[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_nbc_UserAdvManager[5]) and $conf_nbc_UserAdvManager[5] == $status)
+		{
+		  $Valid_Status = $status;
+		}
+		
+/* Template initialization for unvalidated users group */
+      $template->assign(
+	    'Confirm_Status',
+	    array(
+		    'Status_options' => $status_options,
+		    'Status_selected' => $Valid_Status
+		    )
+	    );
+	}
+	
+  $template->assign(
+    array(
+		'UserAdvManager_MAIL_INFO_TRUE'           => $conf_nbc_UserAdvManager[0]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAIL_INFO_FALSE'          => $conf_nbc_UserAdvManager[0]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAILINFO_TEXT'            => $conf_nbc_UserAdvManager[10],
+		'UserAdvManager_NO_CASSE_TRUE'            => $conf_nbc_UserAdvManager[1]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_NO_CASSE_FALSE'           => $conf_nbc_UserAdvManager[1]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_USERNAME_CHAR_TRUE'       => $conf_nbc_UserAdvManager[7]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_USERNAME_CHAR_FALSE'      => $conf_nbc_UserAdvManager[7]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_USERNAME_CHAR_LIST'       => $conf_nbc_UserAdvManager[8],
+		'UserAdvManager_CONFIRM_MAIL_TRUE'        => $conf_nbc_UserAdvManager[2]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_CONFIRM_MAIL_FALSE'       => $conf_nbc_UserAdvManager[2]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_CONFIRMMAIL_TEXT'         => $conf_nbc_UserAdvManager[11],
+		'UserAdvManager_No_Confirm_Group'         => $conf_nbc_UserAdvManager[3],
+		'UserAdvManager_Validated_Group'          => $conf_nbc_UserAdvManager[4],
+		'UserAdvManager_No_Confirm_Status'        => $conf_nbc_UserAdvManager[9],
+		'UserAdvManager_Validated_Status'         => $conf_nbc_UserAdvManager[5],
+		'UserAdvManager_NO_COMMENT_ANO_TRUE'      => $conf_nbc_UserAdvManager[6]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_NO_COMMENT_ANO_FALSE'     => $conf_nbc_UserAdvManager[6]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAILEXCLUSION_TRUE'       => $conf_nbc_UserAdvManager[12]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAILEXCLUSION_FALSE'      => $conf_nbc_UserAdvManager[12]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_MAILEXCLUSION_LIST'       => $conf_nbc_UserAdvManager[13],
+		'UserAdvManager_PASSWORDENF_TRUE'         => $conf_nbc_UserAdvManager[14]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_PASSWORDENF_FALSE'        => $conf_nbc_UserAdvManager[14]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_PASSWORD_SCORE'           => $conf_nbc_UserAdvManager[15],
+    'UserAdvManager_ADMINPASSWENF_TRUE'       => $conf_nbc_UserAdvManager[16]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_ADMINPASSWENF_FALSE'      => $conf_nbc_UserAdvManager[16]=='false' ?  'checked="checked"' : '' ,
+    'UserAdvManager_GHOSTRACKER_TRUE'         => $conf_nbc_UserAdvManager[17]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_GHOSTRACKER_FALSE'        => $conf_nbc_UserAdvManager[17]=='false' ?  'checked="checked"' : '' ,
+    'UserAdvManager_GHOSTRACKER_DAYLIMIT'     => $conf_nbc_UserAdvManager[18],
+    'UserAdvManager_GHOSTRACKER_REMINDERTEXT' => $conf_nbc_UserAdvManager[19],
+		'UserAdvManager_PASSWORD_TEST_SCORE'      => $UserAdvManager_Password_Test_Score,
+    )
+  );
+	
+
+  if (isset($_POST['audit']))
+	{
+		$msg_error1 = '';
+		
+/* username insensible a la casse */
+    if (isset($conf_nbc_UserAdvManager[3]) and $conf_nbc_UserAdvManager[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_array($result))
+	  	{
+				$msg_error1 .= (($msg_error1 <> '') ? '<br/>' : '') . l10n('Err_audit_no_casse').$row['username'];
+			}
+		}
+
+		$msg_error2 = '';
+		
+/* Username without forbidden keys */
+    if ( isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' )
+	  {
+			$query = "
+		  	SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."
+				FROM ".USERS_TABLE."
+			;";
+			  
+			$result = pwg_query($query);
+			
+			while($row = mysql_fetch_array($result))
+			{
+				if (!ValidateUsername($row['username']))
+					$msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char').$row['username'];
+			}
+		}
+
+		$msg_error3 = '';
+		
+/* Email without forbidden domain */
+    if ( isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' )
+	  {
+			$query = "
+		  	SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."
+				FROM ".USERS_TABLE."
+			;";
+			  
+		  $result = pwg_query($query);
+			
+		  while($row = mysql_fetch_array($result))
+		  {
+				$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+			  $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[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').$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('UserAdvManager_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;
+
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                           ConfirmMail Config                          |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'confirmmail':
+	
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+	
+  if (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2]=='true')
+  {
+    if ( isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_ConfirmMail_TimeOut']) )
+		{
+	  	$_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1']));
+	  	$_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2']));
+   		  
+	  	$newconf_nbc_UserAdvManager_ConfirmMail = $_POST['UserAdvManager_ConfirmMail_TimeOut'].';'.$_POST['UserAdvManager_ConfirmMail_Delay'].';'.$_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'].';'.$_POST['UserAdvManager_ConfirmMail_Remail'].';'.$_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'];
+		  
+//NODO:Adding new option [Auto deletion : True | False] - No access to cron functionnalities
+
+	  	$conf['nbc_UserAdvManager_ConfirmMail'] = $newconf_nbc_UserAdvManager_ConfirmMail;
+		
+	  	$query = '
+	    	UPDATE '.CONFIG_TABLE.'
+				SET value="'.$newconf_nbc_UserAdvManager_ConfirmMail.'"
+				WHERE param="nbc_UserAdvManager_ConfirmMail"
+				LIMIT 1
+			;';
+		
+			pwg_query($query);
+		
+			array_push($page['infos'], l10n('UserAdvManager_save_config'));
+		}
+	
+		$conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();		
+
+	  $template->assign(
+	  array(
+		'UserAdvManager_CONFIRMMAIL_TIMEOUT_TRUE'		=> $conf_nbc_UserAdvManager_ConfirmMail[0]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_CONFIRMMAIL_TIMEOUT_FALSE'	=> $conf_nbc_UserAdvManager_ConfirmMail[0]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_CONFIRMMAIL_DELAY'					=> $conf_nbc_UserAdvManager_ConfirmMail[1],
+    'UserAdvManager_CONFIRMMAIL_REMAIL_TRUE'		=> $conf_nbc_UserAdvManager_ConfirmMail[3]=='true' ? 'checked="checked"' : '',
+    'UserAdvManager_CONFIRMMAIL_REMAIL_FALSE'		=> $conf_nbc_UserAdvManager_ConfirmMail[3]=='false' ? 'checked="checked"' : '',
+    'UserAdvManager_CONFIRMMAIL_REMAIL_TXT1'		=> $conf_nbc_UserAdvManager_ConfirmMail[2],
+    'UserAdvManager_CONFIRMMAIL_REMAIL_TXT2'		=> $conf_nbc_UserAdvManager_ConfirmMail[4],
+    	)
+	  );		
+
+// +-----------------------------------------------------------------------+
+// |                             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__) . '/confirmmail.tpl');
+    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');		
+  }
+  else
+  {
+		array_push($page['infos'], l10n('Err_ConfirmMail_Settings'));
+  }
+  break;
+
+
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                           Users manager page                          |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'usermanager':
+  
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
+	
+  if (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2]=='true' and ((isset($conf_nbc_UserAdvManager[3]) and $conf_nbc_UserAdvManager[3] <> '-1') or (isset($conf_nbc_UserAdvManager[9]) and $conf_nbc_UserAdvManager[9] <> '-1')) and isset($conf_nbc_UserAdvManager_ConfirmMail[0]) and $conf_nbc_UserAdvManager_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);
+
+    $page['order_by_items'] = array(
+      'id' => l10n('registration_date'),
+      'username' => l10n('Username'),
+      'level' => l10n('Privacy level'),
+      'language' => l10n('language'),
+    );
+
+// +-----------------------------------------------------------------------+
+// |                               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_array(pwg_query($query));
+				
+      		ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],true);
+      	}
+      	array_push(
+      		$page['infos'],
+        	l10n_dec(
+        		'%d_Mail_With_Key', '%d_Mails_With_Key',
+        	count($collection)
+        	)
+      	);
+      	
+				$page['filtered_users'] = get_unvalid_user_list();
+			}
+		}
+
+// +-----------------------------------------------------------------------+
+// |             Send reminder without new key to users                    |
+// +-----------------------------------------------------------------------+
+// +-----------------------------------------------------------------------+
+// |                            selected users                             |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Mail_Without_Key']))
+		{
+  		$collection = array();
+
+			switch ($_POST['target'])
+    	{
+    		case 'all' :
+      	{
+      		foreach($page['filtered_users'] as $local_user)
+        	{
+        		array_push($collection, $local_user['id']);
+        	}
+        	break;
+				}
+      	case 'selection' :
+      	{
+      		if (isset($_POST['selection']))
+        	{
+        		$collection = $_POST['selection'];
+        	}
+        	break;
+      	}
+			}
+
+    	if (count($collection) == 0)
+    	{
+    		array_push($page['errors'], l10n('Select at least one user'));
+    	}
+		}
+// +-----------------------------------------------------------------------+
+// |             Send reminder without new key to users                    |
+// +-----------------------------------------------------------------------+
+		if (isset($_POST['Mail_Without_Key']) and count($collection) > 0)
+		{
+			if (in_array($conf['guest_id'], $collection))
+   		{
+    		array_push($page['errors'], l10n('No_validation_for_Guest'));
+    	}
+    	if (($conf['guest_id'] != $conf['default_user_id']) and
+    		in_array($conf['default_user_id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('No_validation_for_default_user'));
+    	}
+   		if (in_array($conf['webmaster_id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('No_validation_for_Webmaster'));
+    	}
+    	if (in_array($user['id'], $collection))
+    	{
+    		array_push($page['errors'], l10n('No_validation_for_your_account'));
+    	}
+
+    	if (count($page['errors']) == 0)
+    	{
+    		foreach ($collection as $user_id)
+      	{
+      		$typemail = 2;
+				  $query = "
+						SELECT id, username, mail_address
+						FROM ".USERS_TABLE."
+						WHERE id = '".$user_id."'
+					;";
+					
+					$data = mysql_fetch_array(pwg_query($query));
+				
+      		ResendMail2User($typemail,$user_id,$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_array(pwg_query($query));
+				
+      		ForceValidation($data['id']);				
+      	}
+      	array_push(
+      		$page['infos'],
+        	l10n_dec(
+        		'%d_Validated_User', '%d_Validated_Users',
+       		count($collection)
+        	)
+      	);
+
+				$page['filtered_users'] = get_unvalid_user_list();
+			}
+		}
+		
+
+// +-----------------------------------------------------------------------+
+// |                              groups list                              |
+// +-----------------------------------------------------------------------+
+
+		$groups[-1] = '------------';
+
+    $query = '
+      SELECT id, name
+      FROM '.GROUPS_TABLE.'
+      ORDER BY name ASC
+      ;';
+
+		$result = pwg_query($query);
+          
+    while ($row = mysql_fetch_array($result))
+    {
+      $groups[$row['id']] = $row['name'];
+    }
+
+// +-----------------------------------------------------------------------+
+// |                           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;
+    }
+
+    $template->assign(
+      array(
+        'F_ADD_ACTION' => $base_url,
+        'F_USERNAME' => @htmlentities($_GET['username']),
+        'F_FILTER_ACTION' => get_root_url().'admin.php'
+        )
+   	  );
+
+/* Hide radio-button if not allow to assign adviser */
+		if ($conf['allow_adviser'])
+    	{
+      	$template->assign('adviser', true);
+    	}
+	
+// +-----------------------------------------------------------------------+
+// |                               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']
+         )
+			);
+
+	  	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' => $local_user['username']
+						.($local_user['id'] == $conf['guest_id']
+						? '<BR />['.l10n('is_the_guest').']' : '')
+           	.($local_user['id'] == $conf['default_user_id']
+           	? '<BR />['.l10n('is_the_default').']' : ''),
+					'STATUS' => l10n('user_status_'.
+						$local_user['status']).(($local_user['adviser'] == 'true')
+           	? '<BR />['.l10n('adviser').']' : ''),
+					'EMAIL' => get_email_address_as_display_text($local_user['email']),
+         	'GROUPS' => $groups_string,
+         	'REGISTRATION' => $local_user['registration_date'],
+         	'EXPIRATION' => $expiration,
+				)
+			);
+		}
+
+// +-----------------------------------------------------------------------+
+// |                             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_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+	
+  if (isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[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);
+
+    $page['order_by_items'] = array(
+      'id' => l10n('registration_date'),
+      'username' => l10n('Username'),
+      'level' => l10n('Privacy level'),
+      'language' => l10n('language'),
+    );
+
+// +-----------------------------------------------------------------------+
+// |                               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_array(pwg_query($query));
+				
+      		ghostreminder($user_id,$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();
+			}
+		}
+
+// +-----------------------------------------------------------------------+
+// |                           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;
+    }
+
+    $template->assign(
+      array(
+        'F_ADD_ACTION' => $base_url,
+        'F_USERNAME' => @htmlentities($_GET['username']),
+        'F_FILTER_ACTION' => get_root_url().'admin.php'
+        )
+   	  );
+
+/* Hide radio-button if not allow to assign adviser */
+		if ($conf['allow_adviser'])
+    	{
+      	$template->assign('adviser', true);
+    	}
+
+	
+// +-----------------------------------------------------------------------+
+// |                               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;
+		}
+
+    $reminder = '';
+    if (isset($local_user['reminder']) and $local_user['reminder'] == 'true')
+    {
+      $reminder = l10n('Reminder_Sent_OK');
+    }
+    else if (isset($local_user['reminder']) and $local_user['reminder'] == 'false')
+    {
+      $reminder = l10n('Reminder_Sent_NOK');
+    }
+
+		foreach ($visible_user_list as $local_user)
+    {
+	  	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' => $local_user['username']
+						.($local_user['id'] == $conf['guest_id']
+						? '<BR />['.l10n('is_the_guest').']' : '')
+           	.($local_user['id'] == $conf['default_user_id']
+           	? '<BR />['.l10n('is_the_default').']' : ''),
+					'EMAIL' => get_email_address_as_display_text($local_user['email']),
+          'LASTVISIT' => $local_user['lastvisit'],
+          'REMINDER' => $reminder,
+				)
+			);
+		}
+
+// +-----------------------------------------------------------------------+
+// |                             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/branches/2.12/admin/confirmmail.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/admin/confirmmail.tpl	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/admin/confirmmail.tpl	(revision 4144)
@@ -0,0 +1,37 @@
+<div class="titrePage">
+  <h2>{'Title_Tab2'|@translate}</h2>
+</div>
+
+<form method="post" action="{$UserAdvManager_F_ACTION}" class="general">
+  <fieldset>
+  	<legend>{'ConfirmMail_Title'|@translate}</legend>
+    <ul>
+    	<li><label>{'UserAdvManager_ConfirmMail_Info'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_CONFIRMMAIL_TIMEOUT_TRUE} name="UserAdvManager_ConfirmMail_TimeOut"/> {'UserAdvManager_ConfirmMail_TimeOut_true'|@translate}<br>
+        <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_TIMEOUT_FALSE} name="UserAdvManager_ConfirmMail_TimeOut"/> {'UserAdvManager_ConfirmMail_TimeOut_false'|@translate}<br><br>
+    	</li>
+		<li><label>{'UserAdvManager_ConfirmMail_Delay_Info'|@translate}</label><input type="text" name="UserAdvManager_ConfirmMail_Delay" value="{$UserAdvManager_CONFIRMMAIL_DELAY}" size="5" style="text-align: center;"/><br><br>
+		</li>
+    <li><label>{'UserAdvManager_ConfirmMail_Remail'|@translate}</label><br>
+    	<input type="radio" value="true" {$UserAdvManager_CONFIRMMAIL_REMAIL_TRUE} name="UserAdvManager_ConfirmMail_Remail"/> {'UserAdvManager_ConfirmMail_Remail_true'|@translate}<br>
+      <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_REMAIL_FALSE} name="UserAdvManager_ConfirmMail_Remail"/> {'UserAdvManager_ConfirmMail_Remail_false'|@translate}<br><br>
+    </li>
+ 	{if $UserAdvManager_CONFIRMMAIL_REMAIL_TRUE}
+		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br>
+		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
+	  </li>
+		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br>
+		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
+	  </li>
+  {else}
+		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br>
+		<textarea  name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" readonly{$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
+	  </li>
+		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br>
+		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
+	  </li>
+	{/if}
+    </ul>
+        <p><input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} /></p>
+  </fieldset>
+</form>
Index: /extensions/NBC_UserAdvManager/branches/2.12/admin/global.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/admin/global.tpl	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/admin/global.tpl	(revision 4144)
@@ -0,0 +1,116 @@
+<div class="titrePage">
+  <h2>{'Title_Tab1'|@translate}</h2>
+</div>
+
+<form method="post" action="{$UserAdvManager_F_ACTION}" class="general">
+  <fieldset>
+  	<legend>{'UserAdvManager_Title1'|@translate}</legend>
+    <ul>
+    	<li><label>{'UserAdvManager_No_Casse'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_NO_CASSE_TRUE} name="UserAdvManager_No_Casse">{'UserAdvManager_No_Casse_true'|@translate}<br>
+        <input type="radio" value="false" {$UserAdvManager_NO_CASSE_FALSE} name="UserAdvManager_No_Casse">{'UserAdvManager_No_Casse_false'|@translate}<br>
+    	<br>
+   		</li>
+    	<li><label>{'UserAdvManager_Username_Char'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_USERNAME_CHAR_TRUE} name="UserAdvManager_Username_Char">{'UserAdvManager_Username_Char_true'|@translate}
+        <input type="text" name="UserAdvManager_Username_List" value="{$UserAdvManager_USERNAME_CHAR_LIST}" size="20" style="text-align: center;"><br>
+        <input type="radio" value="false" {$UserAdvManager_USERNAME_CHAR_FALSE} name="UserAdvManager_Username_Char">{'UserAdvManager_Username_Char_false'|@translate}<br><br>
+    	</li>
+      
+    	<li><label>{'UserAdvManager_Password_Enforced'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_PASSWORDENF_TRUE} name="UserAdvManager_Password_Enforced">{'UserAdvManager_Password_Enforced_true'|@translate}
+        <input type="text" name="UserAdvManager_Password_Score" value="{$UserAdvManager_PASSWORD_SCORE}" size="5" style="text-align: center;"><br><br>
+{if $UserAdvManager_PASSWORDENF_TRUE}        
+        <label>{'UserAdvManager_Password_Enforced_Info'|@translate}</label><br><br>
+        {'UserAdvManager_PasswordTest'|@translate}<input type="text" name="UserAdvManager_Password_Test" value="{$UserAdvManager_PASSWORD_TEST}" size="50" style="text-align: left;">&nbsp;&nbsp;&nbsp;
+        <input class="submit" type="submit" value="{'PasswordTest'|@translate}" name="PasswordTest" >&nbsp;&nbsp;&nbsp;
+        {'UserAdvManager_ScoreTest'|@translate}{$UserAdvManager_PASSWORD_TEST_SCORE}<br><br>
+{/if}        
+        <input type="radio" value="false" {$UserAdvManager_PASSWORDENF_FALSE} name="UserAdvManager_Password_Enforced">{'UserAdvManager_Password_Enforced_false'|@translate}<br><br>
+    	</li>
+
+        <li><label>{'UserAdvManager_AdminPassword_Enforced'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_ADMINPASSWENF_TRUE} name="UserAdvManager_AdminPassword_Enforced">{'UserAdvManager_AdminPassword_Enforced_true'|@translate}<br>
+        <input type="radio" value="false" {$UserAdvManager_ADMINPASSWENF_FALSE} name="UserAdvManager_AdminPassword_Enforced">{'UserAdvManager_AdminPassword_Enforced_false'|@translate}<br><br>
+
+    	<li><label>{'UserAdvManager_No_Comment_Anonymous'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_NO_COMMENT_ANO_TRUE} name="UserAdvManager_No_Comment_Anonymous">{'UserAdvManager_No_Comment_Anonymous_true'|@translate}<br>
+        <input type="radio" value="false" {$UserAdvManager_NO_COMMENT_ANO_FALSE} name="UserAdvManager_No_Comment_Anonymous">{'UserAdvManager_No_Comment_Anonymous_false'|@translate}<br><br>
+    	</li>
+      
+    	<li><label>{'UserAdvManager_MailExclusion'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_MAILEXCLUSION_TRUE} name="UserAdvManager_MailExclusion">{'UserAdvManager_MailExclusion_true'|@translate}<br>
+        <input type="radio" value="false" {$UserAdvManager_MAILEXCLUSION_FALSE} name="UserAdvManager_MailExclusion">{'UserAdvManager_MailExclusion_false'|@translate}<br><br>
+    	</li>
+{if $UserAdvManager_MAILEXCLUSION_TRUE}      
+    	<li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
+        <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea><br><br>
+    	</li>
+{/if}
+    	<li><label>{'UserAdvManager_GhostTracker'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_GHOSTRACKER_TRUE} name="UserAdvManager_GhostUser_Tracker">{'UserAdvManager_GhostTracker_true'|@translate}<br>
+        <input type="radio" value="false" {$UserAdvManager_GHOSTRACKER_FALSE} name="UserAdvManager_GhostUser_Tracker">{'UserAdvManager_GhostTracker_false'|@translate}<br><br>
+    	</li>
+{if $UserAdvManager_GHOSTRACKER_TRUE}
+    	<li><label>{'UserAdvManager_GhostTracker_DayLimit'|@translate}</label><br>
+        <input type="text" name="UserAdvManager_GhostTracker_DayLimit" value="{$UserAdvManager_GHOSTRACKER_DAYLIMIT}" size="5" style="text-align: center;"><br><br>
+      </li>
+
+    	<li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br>
+        <textarea name="UserAdvManager_GhostTracker_ReminderText" id="UserAdvManager_GhostTracker_ReminderText" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_GHOSTRACKER_REMINDERTEXT}</textarea><br><br>
+    	</li>
+{/if}
+    </ul>
+    
+  	<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>
+  </fieldset>
+
+    <fieldset>
+    <legend>{'UserAdvManager_Title2'|@translate}</legend>
+    <ul>
+    	<li><label>{'UserAdvManager_Mail_Info'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_MAIL_INFO_TRUE} name="UserAdvManager_Mail_Info">{'UserAdvManager_Mail_Info_true'|@translate}<br>
+        <input type="radio" value="false" {$UserAdvManager_MAIL_INFO_FALSE} name="UserAdvManager_Mail_Info">{'UserAdvManager_Mail_Info_false'|@translate}<br><br>
+    	</li>
+{if $UserAdvManager_MAIL_INFO_TRUE}       
+    	<li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
+        <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br>
+    	</li>
+{/if}
+    	<li><label>{'UserAdvManager_Confirm_Mail'|@translate}</label><br>
+        <input type="radio" value="true" {$UserAdvManager_CONFIRM_MAIL_TRUE} name="UserAdvManager_Confirm_Mail">{'UserAdvManager_Confirm_Mail_true'|@translate}<br>
+        <input type="radio" value="false" {$UserAdvManager_CONFIRM_MAIL_FALSE} name="UserAdvManager_Confirm_Mail">{'UserAdvManager_Confirm_Mail_false'|@translate}<br><br>
+    	</li>
+{if $UserAdvManager_CONFIRM_MAIL_TRUE}      
+    	<li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br>
+        <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br>
+    	</li>
+{/if}
+    	<br>
+			<div style="text-align: center; font-size: 1.1em; color: red;"><b>{'UserAdvManager_Confirm_Group_Notice'|@translate}</b></div>
+			<br>
+      
+    	<li><label>{'UserAdvManager_No_Confirm_Group'|@translate}</label><br>
+		{html_options name="UserAdvManager_No_Confirm_Group" options=$No_Confirm_Group.group_options selected=$No_Confirm_Group.group_selected}<br><br>
+    	</li>
+      
+    	<li><label>{'UserAdvManager_Validated_Group'|@translate}</label><br>
+		{html_options name="UserAdvManager_Validated_Group" options=$Validated_Group.group_options selected=$Validated_Group.group_selected}<br><br>
+    	</li>
+      
+    	<br>
+			<div style="text-align: center; font-size: 1.1em; color: red;"><b>{'UserAdvManager_Confirm_Status_Notice'|@translate}</b></div>
+			<br>
+      
+    	<li><label>{'UserAdvManager_No_Confirm_Status'|@translate}</label><br>
+		{html_options name="UserAdvManager_No_Confirm_Status" options=$No_Confirm_Status.Status_options selected=$No_Confirm_Status.Status_selected}<br><br>
+    	</li>
+      
+    	<li><label>{'UserAdvManager_Validated_Status'|@translate}</label><br>
+		{html_options name="UserAdvManager_Validated_Status" options=$Confirm_Status.Status_options selected=$Confirm_Status.Status_selected}<br><br>
+    	</li>
+    </ul>
+    
+  	<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>
+  </fieldset>
+</form>
Index: /extensions/NBC_UserAdvManager/branches/2.12/admin/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/admin/index.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/admin/index.php	(revision 4144)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/admin/usermanager.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/admin/usermanager.tpl	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/admin/usermanager.tpl	(revision 4144)
@@ -0,0 +1,55 @@
+﻿<div class="titrePage">
+  <h2>{'Title_Tab3'|@translate}</h2>
+</div>
+
+<form method="post" action="{$UserAdvManager_F_ACTION}" class="general">
+  <fieldset>
+  	<legend>{'UserManager_Title'|@translate}</legend>
+    <ul>
+		<li><label>{'UserAdvManager_ConfirmMail_User_List'|@translate}</label><br>
+      <br>
+
+		<table class="table2" width="97%" summary="">
+  			<thead>
+    			<tr class="throw">
+      			<td>&nbsp;</td>
+      			<td>{'Username'|@translate}</td>
+      			<td>{'user_status'|@translate}</td>
+      			<td>{'Email address'|@translate}</td>
+      			<td>{'Groups'|@translate}</td>
+      			<td>{'Registration_Date'|@translate}</td>
+    			</tr>
+  			</thead>
+
+			{foreach from=$users item=user name=users_loop}
+  				<tr class="{if $smarty.foreach.users_loop.index is odd}row1{else}row2{/if}">
+    			<td><input type="checkbox" name="selection[]" value="{$user.ID}" {$user.CHECKED} id="selection-{$user.ID}" ></td>
+    			<td><label for="selection-{$user.ID}">{$user.USERNAME}</label></td>
+    			<td>{$user.STATUS}</td>
+    			<td>{$user.EMAIL}</td>
+    			<td>{$user.GROUPS}</td>
+					<td {if $user.EXPIRATION == True}style="color:red;text-align:center;"{else}style="color:lime;text-align:center;"{/if}>{$user.REGISTRATION}</td>
+    			{foreach from=$user.plugin_columns item=data}
+    			<td>{$data}</td>
+    			{/foreach}    			
+  			</tr>
+  		{/foreach}
+		</table>
+    	<br>
+	    </li>
+    </ul>
+
+<p>
+  {'target'|@translate}
+  <label><input type="radio" name="target" value="all" > {'all'|@translate}</label>
+  <label><input type="radio" name="target" value="selection" checked="checked" > {'selection'|@translate}</label>
+</p>
+
+<p>
+  <input class="submit" type="submit" value="{'Delete_selected'|@translate}" name="Del_Selected" />
+  <input class="submit" type="submit" value="{'Mail_without_key'|@translate}" name="Mail_Without_Key" />
+  <input class="submit" type="submit" value="{'Mail_with_key'|@translate}" name="Mail_With_Key" />
+  <input class="submit" type="submit" value="{'Force_Validation'|@translate}" name="Force_Validation" />
+</p>
+  </fieldset>
+</form>
Index: /extensions/NBC_UserAdvManager/branches/2.12/include/constants.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/include/constants.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/include/constants.php	(revision 4144)
@@ -0,0 +1,5 @@
+<?php
+global $prefixeTable;
+define('USER_CONFIRM_MAIL_TABLE', $prefixeTable.'user_confirm_mail');
+define('USER_LASTVISIT_TABLE', $prefixeTable.'user_lastvisit_check');
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/include/functions_UserAdvManager.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/include/functions_UserAdvManager.inc.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/include/functions_UserAdvManager.inc.php	(revision 4144)
@@ -0,0 +1,896 @@
+<?php
+include_once (NBC_UserAdvManager_PATH.'include/constants.php');
+load_language('plugin.lang', NBC_UserAdvManager_PATH);
+
+/* Function called from main.inc.php to send validation email */
+function SendMail2User($typemail, $id, $username, $password, $email, $confirm)
+{
+  global $conf;
+  load_language('plugin.lang', NBC_UserAdvManager_PATH);
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  
+	include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+  
+	$infos1_perso = "";
+  $infos2_perso = "";
+
+  switch($typemail)
+  {
+    case 1:
+      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Add of %s', $username));
+      $password = $password <> '' ? $password : l10n('UserAdvManager_empty_pwd');
+      
+      if ( function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[10]) and $conf_nbc_UserAdvManager[10] <> '' )
+        $infos1_perso = get_user_language_desc($conf_nbc_UserAdvManager[10])."\n\n";
+      
+      break;
+      
+    case 2:
+      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', $username));
+      $password = $password <> '' ? $password : l10n('UserAdvManager_empty_pwd');
+
+      break;
+        
+    case 3:
+      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', $username));
+      $password = $password <> '' ? $password : l10n('UserAdvManager_no_update_pwd');
+
+      break;
+  }
+
+  if ( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true' )
+  {
+    $infos1 = array(
+      get_l10n_args('infos_mail %s', $username),
+      get_l10n_args('User: %s', $username),
+      get_l10n_args('Password: %s', $password),
+      get_l10n_args('Email: %s', $email),
+      get_l10n_args('', ''),
+    );
+  }
+
+
+  if ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true' and $confirm)
+  {
+    $infos2 = array
+    (
+      get_l10n_args('Link: %s', AddConfirmMail($id, $email)),
+      get_l10n_args('', ''),
+    );
+
+    if ( function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[11]) and $conf_nbc_UserAdvManager[11] <> '' )
+      $infos2_perso = get_user_language_desc($conf_nbc_UserAdvManager[11])."\n\n";
+  }
+
+  pwg_mail($email, array(
+    'subject' => $subject,
+    'content' => (isset($infos1) ? $infos1_perso.l10n_args($infos1)."\n\n" : "").(isset($infos2) ? $infos2_perso.l10n_args($infos2)."\n\n" : "").get_absolute_root_url(),
+  ));
+
+/* ********************** */
+/* Email sending debugger */
+/* This is only to trace  */
+/* the send of emails for */
+/* debugging              */
+/* ********************** */  
+//  MailLog($email,$subject);
+/* ********************** */
+}
+
+
+/* Email sending debugger function */
+//function MailLog  ($to, $subject)
+//{
+//   $fo=fopen (NBC_UserAdvManager_PATH.'admin/maillog.txt','a') ;
+//   fwrite($fo,"======================\n") ;
+//   fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n");
+//   fwrite($fo,$to . "\n" . $subject . "\r\n") ;
+//   fclose($fo) ;
+   //return mail ($to,$subject) ;
+//}
+
+
+/* Function called from UserAdvManager_admin.php to resend validation email with or without new validation key */
+function ResendMail2User($typemail, $user_id, $username, $email, $confirm)
+{
+  global $conf;
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+	$conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
+  
+	include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+  
+	$infos1_perso = "";
+  $infos2_perso = "";
+
+  switch($typemail)
+  {
+    case 1:
+      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_with_key_of_%s', $username));
+      
+      if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and $confirm)
+      {
+				$infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";
+			
+				$infos2 = array
+				(
+					get_l10n_args('Link: %s', ResetConfirmMail($user_id)),
+					get_l10n_args('', ''),
+				);
+			}
+		break;
+      
+    case 2:
+      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_without_key_of_%s', $username));
+      
+      if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and !$confirm)
+      {
+				$infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";
+      }
+    break;
+	}
+  pwg_mail($email, array(
+    'subject' => $subject,
+    'content' => ($infos1."\n\n").(isset($infos2) ? l10n_args($infos2)."\n\n" : "").get_absolute_root_url(),
+  ));
+
+/* ********************** */
+/* Email sending debugger */
+/* This is only to trace  */
+/* the send of emails for */
+/* debugging              */
+/* ********************** */  
+//  MailLog($email,$subject);
+/* ********************** */
+}
+
+
+/* Function called from UserAdvManager_admin.php to send a reminder mail for ghost users */
+function ghostreminder($user_id, $username, $email)
+{
+  global $conf;
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  
+	include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+  
+	$infos1_perso = "";
+
+  $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Ghost_remainder_of_%s', $username));
+      
+  if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[19]) and $conf_nbc_UserAdvManager[19] <> '' and isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[17] == 'true')
+  {
+    $infos1 = get_user_language_desc($conf_nbc_UserAdvManager[19])."\n\n";
+    resetlastvisit($user_id);
+  }
+
+  pwg_mail($email, array(
+    'subject' => $subject,
+    'content' => $infos1.get_absolute_root_url(),
+  ));
+
+/* ********************** */
+/* Email sending debugger */
+/* This is only to trace  */
+/* the send of emails for */
+/* debugging              */
+/* ********************** */  
+//  MailLog($email,$subject);
+/* ********************** */
+}
+
+
+/* Function called from functions AddConfirmMail and ResetConfirmMail for validation key generation */
+function FindAvailableConfirmMailID()
+{
+  while (true)
+  {
+    $id = generate_key(16);
+    $query = "
+SELECT COUNT(*)
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE id = '".$id."'
+;";
+    list($count) = mysql_fetch_row(pwg_query($query));
+
+    if ($count == 0)
+      return $id;
+  }
+}
+
+
+/* Function called from functions SendMail2User to process unvalidated users and generate validation key link */
+function AddConfirmMail($user_id, $email)
+{
+  global $conf;
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  $Confirm_Mail_ID = FindAvailableConfirmMailID();
+
+  list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+  
+  if (isset($Confirm_Mail_ID))
+  {
+    $query = "
+SELECT status
+FROM ".USER_INFOS_TABLE."
+WHERE user_id = '".$user_id."'
+;";
+    list($status) = mysql_fetch_row(pwg_query($query));
+    
+    $query = "
+INSERT INTO ".USER_CONFIRM_MAIL_TABLE."
+  (id, user_id, mail_address, status, date_check)
+VALUES
+  ('".$Confirm_Mail_ID."', '".$user_id."', '".$email."', '".$status."', null)
+;";
+    pwg_query($query);
+
+    $query = "
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$user_id."'
+  AND (
+    group_id = '".$conf_nbc_UserAdvManager[3]."'
+  OR 
+    group_id = '".$conf_nbc_UserAdvManager[4]."'
+  )
+;";
+    pwg_query($query);
+
+    if (!is_admin() and $conf_nbc_UserAdvManager[9] <> -1)
+    {
+      $query = "
+UPDATE ".USER_INFOS_TABLE."
+SET status = '".$conf_nbc_UserAdvManager[9]."'
+WHERE user_id = '".$user_id."'
+;";
+      pwg_query($query);
+    }
+
+    if ( $conf_nbc_UserAdvManager[3] <> -1 )
+    {
+      $query = "
+INSERT INTO ".USER_GROUP_TABLE."
+  (user_id, group_id)
+VALUES
+  ('".$user_id."', '".$conf_nbc_UserAdvManager[3]."')
+;";
+      pwg_query($query);
+    }
+    
+    return get_absolute_root_url().NBC_UserAdvManager_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID;
+  }
+}
+
+
+/* Function called from UserAdvManager_admin.php to reset validation key */
+function ResetConfirmMail($user_id)
+{
+  global $conf;
+  
+  $Confirm_Mail_ID = FindAvailableConfirmMailID();
+
+  list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+  
+  if (isset($Confirm_Mail_ID))
+  { 
+    $query = "
+UPDATE ".USER_CONFIRM_MAIL_TABLE."
+SET id = '".$Confirm_Mail_ID."'
+WHERE user_id = '".$user_id."'
+;";
+    pwg_query($query);
+
+		$query = "
+UPDATE ".USER_INFOS_TABLE."
+SET registration_date = '".$dbnow."'
+WHERE user_id = '".$user_id."'
+;";
+		pwg_query($query);
+    
+    return get_absolute_root_url().NBC_UserAdvManager_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID;
+  }
+}
+
+
+/* Function called from function_UserAdvManager.inc.php to reset last visit date after sending a reminder */
+function resetlastvisit($user_id)
+{
+  global $conf;
+
+  list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+  $query = "
+UPDATE ".USER_LASTVISIT_TABLE."
+SET lastvisit = '".$dbnow."'
+WHERE user_id = '".$user_id."'
+;";
+  pwg_query($query);
+}
+
+
+/* Function called from main.inc.php - Triggered on user deletion */
+function DeleteConfirmMail($user_id)
+{
+  $query = "
+DELETE FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE user_id = '".$user_id."'
+;";
+  pwg_query($query);
+}
+
+
+/* Function called from ConfirmMail.php to verify validation key used by user according time limit */
+function VerifyConfirmMail($id)
+{
+  global $conf;
+
+  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+  
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
+
+  $query = "
+SELECT COUNT(*)
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE id = '".$id."'
+;";
+  list($count) = mysql_fetch_row(pwg_query($query));
+
+  if ($count == 1)
+  {
+    $query = "
+SELECT user_id, status, date_check
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE id = '".$id."'
+;";
+    $data = mysql_fetch_array(pwg_query($query));
+        
+    if (!empty($data) and isset($data['user_id']) and !isset($data['date_check']))
+    {
+      $query = "
+SELECT registration_date
+FROM ".USER_INFOS_TABLE."
+WHERE user_id = '".$data['user_id']."'
+;";
+      list($registration_date) = mysql_fetch_row(pwg_query($query));
+
+/*              Time limit process              */
+/* ****************** begin ******************* */  
+      if (!empty($registration_date))
+      {
+				// Verify Confirmmail with time limit ON
+				if (isset ($conf_nbc_UserAdvManager_ConfirmMail[1]))
+				{
+					// 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(' ', $registration_date); // 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
+
+					// Condition with the value set for time limit
+					if ($deltadays <= $conf_nbc_UserAdvManager_ConfirmMail[1]) // If Nb of days is less than the limit set
+					{
+						list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+						$query = '
+UPDATE '.USER_CONFIRM_MAIL_TABLE.'
+SET date_check="'.$dbnow.'"
+WHERE id = "'.$id.'"
+;';
+						pwg_query($query);
+      
+						if ($conf_nbc_UserAdvManager[3] <> -1) // Delete user from unvalidated users group
+						{
+							$query = "
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+  AND group_id = '".$conf_nbc_UserAdvManager[3]."'
+;";
+							pwg_query($query);
+						}
+	    
+						if ($conf_nbc_UserAdvManager[4] <> -1) // Add user to validated users group 
+						{
+							$query = "
+INSERT INTO ".USER_GROUP_TABLE."
+  (user_id, group_id)
+VALUES
+  ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
+;";
+							pwg_query($query);
+						}
+
+						if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status']))) // Change user's status
+						{
+							$query = "
+UPDATE ".USER_INFOS_TABLE."
+SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
+WHERE user_id = '".$data['user_id']."'
+;";
+							pwg_query($query);
+						}
+						// Refresh user's category cache
+						invalidate_user_cache();
+  
+						return true;
+					}
+					elseif ($deltadays > $conf_nbc_UserAdvManager_ConfirmMail[1]) // If timelimit exeeds
+					{
+						return false;
+					}
+				}
+				// Verify Confirmmail with time limit OFF
+				else
+				{
+					list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+					$query = '
+UPDATE '.USER_CONFIRM_MAIL_TABLE.'
+SET date_check="'.$dbnow.'"
+WHERE id = "'.$id.'"
+;';
+					pwg_query($query);
+      
+					if ($conf_nbc_UserAdvManager[3] <> -1)
+					{
+						$query = "
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+AND group_id = '".$conf_nbc_UserAdvManager[3]."'
+;";
+						pwg_query($query);
+					}
+    
+					if ($conf_nbc_UserAdvManager[4] <> -1)
+					{
+						$query = "
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+AND group_id = '".$conf_nbc_UserAdvManager[4]."'
+;";
+						pwg_query($query);
+
+						$query = "
+INSERT INTO ".USER_GROUP_TABLE."
+  (user_id, group_id)
+VALUES
+  ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
+;";
+						pwg_query($query);
+					}
+
+					if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status'])))
+					{
+						$query = "
+UPDATE ".USER_INFOS_TABLE."
+SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
+WHERE user_id = '".$data['user_id']."'
+;";
+						pwg_query($query);
+					}
+					// Refresh user's category cache
+					invalidate_user_cache();
+  
+					return true;
+				}
+			}
+		}
+	}
+  else
+    return false;
+}
+
+/* Function called from UserAdvManager_admin.php to force users validation by admin */
+function ForceValidation($id)
+{
+  global $conf;
+
+  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+  
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+        
+  $query = "
+SELECT COUNT(*)
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE user_id = '".$id."'
+;";
+  list($count) = mysql_fetch_row(pwg_query($query));
+
+  if ($count == 1)
+  {
+    $query = "
+SELECT user_id, status, date_check
+FROM ".USER_CONFIRM_MAIL_TABLE."
+WHERE user_id = '".$id."'
+;";
+    $data = mysql_fetch_array(pwg_query($query));
+
+    if (!empty($data) and isset($data['user_id']) and !isset($data['date_check']))
+    {      
+			list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+			$query = "
+UPDATE ".USER_CONFIRM_MAIL_TABLE."
+SET date_check='".$dbnow."'
+WHERE user_id = '".$data['user_id']."'
+;";
+			pwg_query($query);
+	     
+			if ($conf_nbc_UserAdvManager[3] <> -1)
+			{
+				$query = "
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+  AND group_id = '".$conf_nbc_UserAdvManager[3]."'
+;";
+				pwg_query($query);
+			}
+  
+			if ($conf_nbc_UserAdvManager[4] <> -1)
+			{
+				$query = "
+DELETE FROM ".USER_GROUP_TABLE."
+WHERE user_id = '".$data['user_id']."'
+  AND group_id = '".$conf_nbc_UserAdvManager[4]."'
+				;";
+				pwg_query($query);
+	
+				$query = "
+INSERT INTO ".USER_GROUP_TABLE."
+  (user_id, group_id)
+VALUES
+  ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
+;";
+				pwg_query($query);
+			}
+
+			if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status'])))
+			{
+				$query = "
+UPDATE ".USER_INFOS_TABLE."
+SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
+WHERE user_id = '".$data['user_id']."'
+;";
+				pwg_query($query);
+			}
+			// Refresh user's category cache
+			invalidate_user_cache();
+			return true;
+		}
+	}
+}
+
+/* Function called from main.inc.php - Get username case insensitive */
+function NotSensibleSearchUsername($username)
+{
+  global $conf;
+  
+  if (isset($username))
+  {
+    $query = "
+SELECT ".$conf['user_fields']['username']."
+FROM ".USERS_TABLE."
+WHERE LOWER(".$conf['user_fields']['username'].") = '".strtolower($username)."'
+;";
+    list($username) = mysql_fetch_row(pwg_query($query));
+
+    return isset($username) ? $username : '';
+  }
+}
+
+
+/* Function called from main.inc.php - Check if username matches forbidden caracters */
+function ValidateUsername($login)
+{
+  global $conf;
+
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+  if (isset($login) and isset($conf_nbc_UserAdvManager[8]) and $conf_nbc_UserAdvManager[8] <> '')
+  {
+  	$pattern = '/'.$conf_nbc_UserAdvManager[8].'/';
+    if ( preg_match($pattern, $login) )
+      return false;
+    else
+      return true;
+  }
+  else
+  {
+    return true;
+  }
+}
+
+
+/* Function called from main.inc.php - Check if user's email is in excluded email providers list */
+function ValidateEmailProvider($email)
+{
+  global $conf;
+
+	$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+	if (isset($conf_nbc_UserAdvManager[12]))
+	{
+		$ncsemail = strtolower($email);
+		$conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
+		for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+		{
+			$pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
+			if (preg_match($pattern, $ncsemail))
+        		return false;
+        	else
+      			return true;
+		}
+	}
+}
+
+
+/* Function called from UserAdvManager.php - Get unvalidated users according time limit */
+function get_unvalid_user_list()
+{
+	global $conf, $page;
+          
+	/* Get ConfirmMail configuration */
+	$conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
+          
+	/* Get UserAdvManager configuration */
+	$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();  
+  
+  $users = array();
+
+	/* search users depending expiration date */
+  $query = '
+SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
+                u.'.$conf['user_fields']['username'].' AS username,
+                u.'.$conf['user_fields']['email'].' AS email,
+                ui.status,
+                ui.adviser,
+                ui.enabled_high,
+                ui.level,
+                ui.registration_date
+FROM '.USERS_TABLE.' AS u
+  INNER JOIN '.USER_INFOS_TABLE.' AS ui
+    ON u.'.$conf['user_fields']['id'].' = ui.user_id
+  LEFT JOIN '.USER_GROUP_TABLE.' AS ug
+    ON u.'.$conf['user_fields']['id'].' = ug.user_id
+  WHERE u.'.$conf['user_fields']['id'].' >= 3
+    AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'"
+    OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'")';
+
+	if ($conf_nbc_UserAdvManager[3] <> '-1' and $conf_nbc_UserAdvManager[9] == '-1')
+  {
+    $query.= '
+  AND ug.group_id = '.$conf_nbc_UserAdvManager[3];
+  }
+  if ($conf_nbc_UserAdvManager[3] == '-1' and $conf_nbc_UserAdvManager[9] <> '-1')
+  {
+    $query.= '
+  AND ui.status = \''.$conf_nbc_UserAdvManager[9]."'";
+  }
+  if ($conf_nbc_UserAdvManager[3] <> '-1' and $conf_nbc_UserAdvManager[9] <> '-1')
+  {
+    $query.= '
+  AND ug.group_id = \''.$conf_nbc_UserAdvManager[3]."'";
+  }
+  $query.= '
+ORDER BY id ASC
+;';
+
+	$result = pwg_query($query);
+      
+  while ($row = mysql_fetch_array($result))
+  {
+  	$user = $row;
+    $user['groups'] = array();
+
+    array_push($users, $user);
+	}
+
+	/* add group lists */
+  $user_ids = array();
+  foreach ($users as $i => $user)
+  {
+  	$user_ids[$i] = $user['id'];
+	}
+	
+	$user_nums = array_flip($user_ids);
+
+  if (count($user_ids) > 0)
+  {
+  	$query = '
+SELECT user_id, group_id
+FROM '.USER_GROUP_TABLE.'
+WHERE user_id IN ('.implode(',', $user_ids).')
+;';
+        
+		$result = pwg_query($query);
+        
+    while ($row = mysql_fetch_array($result))
+    {
+    	array_push(
+      	$users[$user_nums[$row['user_id']]]['groups'],
+        $row['group_id']
+			);
+		}
+	}
+
+	return $users;
+}
+
+
+/* Function called from UserAdvManager.php - Get ghost users */
+function get_ghost_user_list()
+{
+	global $conf, $page;
+          
+	/* Get UserAdvManager configuration */
+	$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();  
+  
+  $users = array();
+
+	/* search users depending expiration date */
+  $query = '
+SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
+                u.'.$conf['user_fields']['username'].' AS username,
+                u.'.$conf['user_fields']['email'].' AS email,
+                lv.lastvisit,
+                lv.reminder
+FROM '.USERS_TABLE.' AS u
+  INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv
+    ON u.'.$conf['user_fields']['id'].' = lv.user_id
+WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_nbc_UserAdvManager[18].'")
+ORDER BY id ASC;';
+
+	$result = pwg_query($query);
+      
+  while ($row = mysql_fetch_array($result))
+  {
+  	$user = $row;
+    $user['groups'] = array();
+
+    array_push($users, $user);
+	}
+
+	/* add group lists */
+  $user_ids = array();
+  foreach ($users as $i => $user)
+  {
+  	$user_ids[$i] = $user['id'];
+	}
+
+	return $users;
+}
+
+
+/* Function called from UserAdvManager.php - to determine who is expired or not and giving a different display color */
+function expiration($id)
+{
+	global $conf, $page;
+          
+	/* Get ConfirmMail configuration */
+	$conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
+          
+	/* Get UserAdvManager configuration */
+	$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); 
+	
+	$query = "
+SELECT registration_date
+FROM ".USER_INFOS_TABLE."
+WHERE user_id = '".$id."'
+;";
+	list($registration_date) = mysql_fetch_row(pwg_query($query));
+
+/*              Time limit process              */
+/* ****************** begin ******************* */  
+	if (!empty($registration_date))
+  {
+		// 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(' ', $registration_date); // 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
+
+		// Condition with the value set for time limit
+		if ($deltadays <= $conf_nbc_UserAdvManager_ConfirmMail[1]) // If Nb of days is less than the limit set
+		{
+			return false;
+		}
+		else
+		{
+			return True;
+		}
+	}
+}
+
+
+/**
+ * Returns a password's score for password complexity check
+ *
+ * @param password filled by user
+ * 
+ * Thanx to MathieuGut from http://m-gut.developpez.com
+ */
+function testpassword($password) // Le mot de passe passé en paramètre - $password given by user
+{
+
+  // Initialisation des variables - Variables initiation
+  $points = 0;
+  $point_lowercase = 0;
+  $point_uppercase = 0;
+  $point_numbers = 0;
+  $point_characters = 0;
+
+  // On récupère la longueur du mot de passe - Getting password lengh	
+  $length = strlen($password);
+  
+  // On fait une boucle pour lire chaque lettre - Loop to read password characters
+  for($i = 0; $i < $length; $i++)
+  {
+    // On sélectionne une à une chaque lettre - Select each letters
+    // $i étant à 0 lors du premier passage de la boucle - $i is 0 at first turn
+    $letters = $password[$i];
+
+    if ($letters>='a' && $letters<='z')
+    {
+      // On ajoute 1 point pour une minuscule - Adding 1 point to score for a lowercase
+		  $points = $points + 1;
+
+		  // On rajoute le bonus pour une minuscule - Adding bonus points for lowercase
+		  $point_lowercase = 1;
+    }
+    else if ($letters>='A' && $letters <='Z')
+    {
+      // On ajoute 2 points pour une majuscule - Adding 2 points to score for uppercase
+      $points = $points + 2;
+		
+      // On rajoute le bonus pour une majuscule - Adding bonus points for uppercase
+      $point_uppercase = 2;
+    }
+    else if ($letters>='0' && $letters<='9')
+    {
+      // On ajoute 3 points pour un chiffre - Adding 3 points to score for numbers
+      $points = $points + 3;
+		
+      // On rajoute le bonus pour un chiffre - Adding bonus points for numbers
+      $point_numbers = 3;
+    }
+    else
+    {
+      // On ajoute 5 points pour un caractère autre - Adding 5 points to score for special characters
+      $points = $points + 5;
+		
+      // On rajoute le bonus pour un caractère autre - Adding bonus points for special characters
+      $point_characters = 5;
+    }
+  }
+
+  // Calcul du coefficient points/longueur - calculating the coefficient points / length
+  $step1 = $points / $length;
+
+  // Calcul du coefficient de la diversité des types de caractères... - Calculation of the diversity of character types...
+  $step2 = $point_lowercase + $point_uppercase + $point_numbers + $point_characters;
+
+  // Multiplication du coefficient de diversité avec celui de la longueur - Multiplying the coefficient of diversity with that of the length
+  $score = $step1 * $step2;
+
+  // Multiplication du résultat par la longueur de la chaîne - Multiplying the result by the length of the chain
+  $finalscore = $score * $length;
+
+  return $finalscore;
+}
+
+/* Function called from maintain.inc.php - to check if database upgrade is needed */
+function table_exist($table)
+{
+  $query = 'DESC '.$table.';';
+  return (bool)($res=mysql_query($query));
+}
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/include/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/include/index.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/include/index.php	(revision 4144)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/index.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/index.php	(revision 4144)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/index.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/index.php	(revision 4144)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/plugin.lang.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/plugin.lang.php	(revision 4144)
@@ -0,0 +1,176 @@
+<?php
+
+global $lang,$conf;
+
+$conf_UserAdvManager = isset($conf['UserAdvManager']) ? explode(";" , $conf['UserAdvManager']) : array();
+
+
+/* Global Configuration Tab */
+$lang['Title_Tab1'] = 'UserAdvManager - General Setup';
+$lang['Tab_Global'] = 'General Setup';
+$lang['UserAdvManager_Title1'] = 'Users registration management';
+$lang['UserAdvManager_Title2'] = 'Registration validation and groups / status management';
+$lang['UserAdvManager_Mail_Info'] = ' Mail information user (<b style="color: green;">activate and save settings to display the customizable email content</b> - <b style="color: red;">Caution: If, after configuration, you disable this option, you will lose any related customizations!</b>).';
+$lang['UserAdvManager_Mail_Info_true'] = ' Send an information mail to the user when he registes or updates his profile.';
+$lang['UserAdvManager_Mail_Info_false'] = ' Turns off the sending of mail. (default)';
+$lang['UserAdvManager_MailInfo_Text'] = ' Text used to introduce the email sent to user to allow him to validate his email address<br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
+$lang['UserAdvManager_No_Casse'] = ' User insensitive';
+$lang['UserAdvManager_No_Casse_true'] = ' Make the user account insensitive at the registration and the identification step';
+$lang['UserAdvManager_No_Casse_false'] = ' Let the user-sensitive. (default)';
+$lang['UserAdvManager_Username_Char'] = ' Limited charset for unsername';
+$lang['UserAdvManager_Username_Char_true'] = ' The following characters will be forbidden for username choice';
+$lang['UserAdvManager_Username_Char_false'] = ' Use the default username charset control. (default)';
+$lang['UserAdvManager_Password_Enforced'] = 'Strengthening passwords - Enabling this option makes the seizure of the password required for visitors registration. Also, the password entered by the visitor will meet with a score of complexity (<b style="color: green;">activate and save settings to display more informations</b>).';
+$lang['UserAdvManager_Password_Enforced_Info'] = '<b style="text-decoration: underline; color: green;">Explanations:</b> <b style="color: green;">A password score is calculated on the basic parameters: length, type of characters used (letters, digits, uppercase, lowercase, special characters). If the password of the user does not score, the score reached is displayed with the minimal score to reach and an indication to increase the value of this score. To give you an idea, a score below 100 is considered "low complexity". Between 100 and 500, the complexity is increased and average. Beyond 500, that\'s Fort Knox! ;-)<br>You can do your passwords complexity tests by using the field below. This will allow you to get an idea of the score to define a custom complexity.</b>';
+$lang['UserAdvManager_PasswordTest'] = 'Passowrd to test : ';
+$lang['UserAdvManager_ScoreTest'] = 'Score : ';
+$lang['PasswordTest'] = 'Score calculation';
+$lang['UserAdvManager_Password_Enforced_true'] = ' Strong password required - Enter the minimum score (floor value) of passwords complexity == ';
+$lang['UserAdvManager_Password_Enforced_false'] = ' Do not strengthen passwords. (default)';
+$lang['UserAdvManager_AdminPassword_Enforced'] = 'Apply also the passwords complexity control when an administrator create a user? Note: If the created user wishes to change his password and strengthening passwords for users is active, he will be subject to the rules set.';
+$lang['UserAdvManager_AdminPassword_Enforced_true'] = 'Enable strengthening passwords for admins.';
+$lang['UserAdvManager_AdminPassword_Enforced_false'] = 'Disable strengthening passwords for admins. (default)';
+$lang['UserAdvManager_Confirm_Mail'] = 'Email address confirmation (<b style="color: green;">activate and save settings to display the customizable email content</b> - <b style="color: red;">Caution: If, after configuration, you disable this option, you will lose any related customizations!</b>).';
+$lang['UserAdvManager_Confirm_Mail_true'] = ' Send an email to user to allow him to validate his email and his registration.';
+$lang['UserAdvManager_Confirm_Mail_false'] = ' Use the default Piwigo registration system (without registration validation). (default)';
+$lang['UserAdvManager_ConfirmMail_Text'] = ' Text used to introduce the email sent to user to allow him to validate his email address<br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
+$lang['UserAdvManager_Confirm_Group_Notice'] = 'WARNING : Using validation groups requires that you have created at least one user group and is defined "by default" in Piwigo\'s user groups management.';
+$lang['UserAdvManager_No_Confirm_Group'] = 'Group to use for the users who haven\'t validated their email address.';
+$lang['UserAdvManager_Validated_Group'] = 'Group to use for the users who have validated their email address.';
+$lang['UserAdvManager_Confirm_Status_Notice'] = 'WARNING : The use of status validation requires that you have kept the "Guest" user with default setting (as user template) for new registered. Note you can set any other user as a template for new registered. Please refer to the Piwigo\'s documentation for more details.';
+$lang['UserAdvManager_No_Confirm_Status'] = 'Status to use for the users who haven\'t validated their email address.';
+$lang['UserAdvManager_Validated_Status'] = 'Status to use for the users who have validated their email address. Let ------- for using default Piwigo values';
+$lang['UserAdvManager_No_Comment_Anonymous'] = 'Nickname are mandatory for comments';
+$lang['UserAdvManager_No_Comment_Anonymous_true'] = ' The author field have to be filled to send a comment.';
+$lang['UserAdvManager_No_Comment_Anonymous_false'] = ' Use the default Piwigo settings on comments sending. (default)';
+$lang['UserAdvManager_MailExclusion'] = 'Email provider exclusion (<b style="color: green;">activate and save settings to display the exclusion list field</b> - <b style="color: red;">Caution: If, after configuration, you disable this option, you will lose any related customizations!</b>)';
+$lang['UserAdvManager_MailExclusion_true'] = ' Set the email provider exclusion ON (i.e. : @hotmail.* or @msn.*)';
+$lang['UserAdvManager_MailExclusion_false'] = ' Set the email provider exclusion OFF. (default)';
+$lang['UserAdvManager_MailExclusion_List'] = ' If email provider exclusion is set to ON, fill the email domains to exclude below. You have to use the following format :<br>@[domaine_name].[domaine_extension] - Example : @hotmail.com<br>Seperate the different domains with a comma (,)<br>';
+$lang['UserAdvManager_GhostTracker'] = 'Ghost Tracker - Allows to manage registered users according their last visit date (<b style="color: green;">activate and save settings to display more options</b> - <b style="color: red;">Caution: If, after configuration, you disable this option, you will lose any related customizations!</b>) :';
+$lang['UserAdvManager_GhostTracker_true'] = ' Enable Ghost Tracker.';
+$lang['UserAdvManager_GhostTracker_false'] = ' Disable Ghost Tracker. (Default)';
+$lang['UserAdvManager_GhostTracker_DayLimit'] = ' Type in here the maximum limit, in days, between two visits of a visitor. When this limit is reached, this visitor will appear in the table on "Ghost Tracker" tab.';
+$lang['UserAdvManager_GhostTracker_ReminderText'] = ' Text used in the email reminder sent to encourage visitors to come back to the gallery (NB: The text pre-filled at the plugin installation is given as an example).<br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
+
+
+/* ConfirmMail Configuration Tab */
+$lang['ConfirmMail_Title'] = 'Advanced management and settings of register confirmation by mail';
+$lang['Title_Tab2'] = 'UserAdvManager - ConfirmMail Settings';
+$lang['Tab_ConfirmMail'] = 'ConfirmMail Settings';
+$lang['UserAdvManager_ConfirmMail_Info'] = 'Time limitation for validation of registration :<br>If you enable this option, select the desired time (x) )in the field below. Visitors who register will then have x days to validate their registration. After this period the validation link they have received by mail will be expired.<br>';
+$lang['UserAdvManager_ConfirmMail_TimeOut_true'] = 'Enable limiting the registration deadline.';
+$lang['UserAdvManager_ConfirmMail_TimeOut_false'] = 'Disable limiting the registration deadline. (Default)';
+$lang['UserAdvManager_ConfirmMail_TimeOut'] = 'Validation delay :';
+$lang['UserAdvManager_ConfirmMail_Delay_Info'] = 'Enter the number of days before expiry of the registration validation : ';
+$lang['UserAdvManager_ConfirmMail_Remail'] = 'Enable or disable email reminder of unvalidated registers :';
+$lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Enable email reminder';
+$lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Disable email reminder. (Default)';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Custom content of the reminder message with regeneration of validation key.<br>If left blank, the reminder email will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled at the plugin installation is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Custom content of the reminder message without regeneration of validation key.<br>If left blank, the reminder email will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled at the plugin installation is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
+
+
+/* UserManager Tab */
+$lang['UserManager_Title'] = 'Advanced settings of unvalidated registered users';
+$lang['Title_Tab3'] = 'UserAdvManager - Visitors management';
+$lang['Tab_UserManager'] = 'Visitors management';
+$lang['UserAdvManager_ConfirmMail_User_List'] = 'When limiting the deadline for registration is enabled, you will find below the list of users awaiting validation, <b style="text-decoration: underline;">whether or not</b> they are in time to validate.<br><br>In this view, you can:
+<br><br>
+- Manually delete accounts <b>(manual drain)</b>
+<br>
+- Generate email reminder <b>without</b> generating a new key. Warning: Send an email reminder to targeted visitors. This function does not reset the date of registration of targeted visitors and the timeout is still valid.
+<br>
+- Generate email reminder <b>with</b> generating a new key. Warning : Send an email reminder to targeted visitors. This function also resets the date of registration of targeted visitors which equates to extend the deadline for validation.<br>
+- Submit a registration awaiting validation manually even if the expiry date has passed <b>(forcing validation)</b>.
+<br>';
+$lang['Registration_Date'] = 'Registration date';
+
+
+/* Ghost Tracker Tab */
+$lang['GhostTracker_Title'] = 'Advanced ghost visitors management';
+$lang['Title_Tab4'] = 'UserAdvManager - Ghost Tracker';
+$lang['Tab_GhostTracker'] = 'Ghost Tracker';
+$lang['UserAdvManager_GhostTracker_User_List'] = 'When Ghost Tracker is enabled, you will find below the list of registered visitors who have not returned since x days. "x" is the number of days configured in the General Setup tab. In addition, you will find a column indicating whether an email reminder has been sent to targeted visitors. So, you can see at a glance and treat visitors who have not taken account of the reminder.<br><br>In this view, you can:
+<br><br>
+- Manually delete accounts <b>(manual drain)</b>
+<br>
+- Generate email reminder <b>with resetting the last visit date</b>. This allows to give a wildcard to targeted visitors. If the visitor has already received a reminder, nothing prevents to resent a new mail which will reset again, in fact, the last visit date.
+<br>';
+$lang['LastVisit_Date'] = 'Last visit';
+$lang['Ghost_Reminder'] = 'Email reminder';
+$lang['Reminder_Sent_OK'] = 'YES';
+$lang['Reminder_Sent_NOK'] = 'NO';
+
+
+/* Mailing */
+$lang['infos_mail %s'] = '%s, please find here your information to login the gallery :';
+$lang['User: %s'] = 'User : %s';
+$lang['Password: %s'] = 'Password: %s';
+$lang['Add of %s'] = 'Add of %s';
+$lang['Update of %s'] = 'Update of %s';
+$lang['Link: %s'] = 'Please, click on this link to confirm your regsitration : %s';
+$lang['Reminder_with_key_of_%s'] = '%s, your validation key has been renewed';
+$lang['Reminder_without_key_of_%s'] = '%s, your validation key will expire';
+$lang['Ghost_remainder_of_%s'] = '%s, this is a reminder email';
+
+
+/* Email confirmation page */
+$lang['title_confirm_mail'] = 'Validate your registration';
+$lang['confirm_mail_page_title'] = 'Validate your registration';
+$lang['confirm_mail_ok'] = '<br><br><br>Thank you to have confirmed your email address and your registration on the gallery. Have fun !<br><br><br><br>';
+$lang['confirm_mail_bad'] = '<br><br><br>Your activation key is incorrect or expired or you have already validated your account, please contact the webmaster to fix this problem.<br><br><br><br>';
+
+
+/* Errors and Warnings */
+$lang['UserAdvManager_audit_ok'] = 'Audit OK';
+$lang['UserAdvManager_save_config'] ='Configuration saved.';
+$lang['Err_audit_no_casse'] = '<b>These accounts are identical to the case closely :</b> ';
+$lang['Err_audit_username_char'] = '<b>This account uses one or more forbidden characters :</b> ';
+$lang['Err_audit_email_forbidden'] = '<b>This account uses a forbidden email provider :</b> ';
+$lang['Err_audit_advise'] = '<b>you have to perform corrections to comply with new rules that you have activated.<br>Use a database management utility to correct user accounts directly in the table ### _USERS';
+$lang['UserAdvManager_Empty Author'] = 'The author field have to be filled to send a comment.';
+$lang['reg_err_login3'] = 'Security : Password is mandatory !';
+$lang['reg_err_login4_%s'] = 'Security : A control system calculates a score on the chosen passwords complexity. The complexity of your password is too low (score = %s). Please, choose a new password more secure by following these rules:<br>
+- Use letters and numbers<br>
+- Use lowercase and uppercase<br>
+- Increase its length (number of characters)<br>
+The minimum passwords score required by the administrator is: ';
+if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
+	$lang['reg_err_login5'] = 'Username already exist, WARNING name is case insensitive (Shift = Tiny).';
+$lang['reg_err_login6'] = 'Username does not match the following characters: ';
+$lang['reg_err_login7'] = 'Your email provider is banned for registration. Banned email providers are: ';
+$lang['UserAdvManager_empty_pwd'] = '[empty password]';
+$lang['UserAdvManager_no_update_pwd'] = '[profile updated without password changed]';
+$lang['invalid_pwd'] = 'Invalid username or password !';
+$lang['Err_ConfirmMail_Settings'] = 'This page will be available only if "Email address confirmation" is activated in "General Setup" tab.';
+$lang['Err_UserManager_Settings'] = 'This page is available only if "Enable limiting the registration deadline" is active in the "ConfirmMail Settings" tab and an unvalidated users group is set in "General Setup" tab.';
+$lang['Err_GhostTracker_Settings'] = 'This page is available only if "Ghost Tracker" is active in the "General Setup" tab.';
+$lang['No_validation_for_Guest'] = 'The "Guest" account is not subject to validation';
+$lang['No_validation_for_default_user'] = 'The default account is not subject to validation';
+$lang['No_validation_for_Webmaster'] = 'The "Webmaster" account is not subject to validation';
+$lang['No_validation_for_your_account'] = 'You personnal admin account is not subject to validation';
+$lang['Database_Error'] = '<b><u>Warning! Critical integrity error in your database.</u></b><br><br>Please check the integrity of the #_user_confirm_mail table.';
+$lang['No_reminder_for_Guest'] = 'The "Guest" account is not subject to receive reminders from GhostTracker';
+$lang['No_reminder_for_default_user'] = 'The default account is not subject to receive reminders from GhostTracker';
+$lang['No_reminder_for_Webmaster'] = 'The "Webmaster" account is not subject to receive reminders from GhostTracker';
+$lang['No_reminder_for_your_account'] = 'You personnal admin account is not subject to receive reminders from GhostTracker';
+
+
+/* Processing messages */
+$lang['%d_Mail_With_Key'] = '%d message with key renewal was sent';
+$lang['%d_Mails_With_Key'] = '%d messages with key renewal were sent';
+$lang['%d_Reminder_Sent'] = '%d reminder message was sent';
+$lang['%d_Reminders_Sent'] = '%d reminder messages were sent';
+$lang['%d_Validated_User'] = '%d User validated manually';
+$lang['%d_Validated_Users'] = '%d Users validated manually';
+
+
+/* Action button names */
+$lang['audit'] = 'Audit settings';
+$lang['submit'] = 'Save settings';
+$lang['Delete_selected'] = 'Delete';
+$lang['Mail_without_key'] = 'Reminder without key';
+$lang['Mail_with_key'] = 'Reminder with key';
+$lang['Force_Validation'] = 'Forced validation';
+$lang['Reminder_Email'] = 'Email reminder';
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/index.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/index.php	(revision 4144)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/plugin.lang.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/plugin.lang.php	(revision 4144)
@@ -0,0 +1,175 @@
+<?php
+
+global $lang,$conf;
+
+$conf_UserAdvManager = isset($conf['UserAdvManager']) ? explode(";" , $conf['UserAdvManager']) : array();
+
+
+/* Global Configuration Tab */
+$lang['Title_Tab1'] = 'UserAdvManager - Configuration Générale';
+$lang['Tab_Global'] = 'Configuration Générale';
+$lang['UserAdvManager_Title1'] = 'Gestion de l\'inscription des utilisateurs';
+$lang['UserAdvManager_Title2'] = 'Validation d\'inscription et gestion de groupes / statuts';
+$lang['UserAdvManager_Mail_Info'] = 'Mail d\'information à l\'utilisateur (<b style="color: green;">activez puis sauvegardez pour afficher le contenu paramétrable du mail</b> - <b style="color: red;">Attention : Si, après configuration, vous désactivez cette option, vous perdrez les personnalisations s\'y afférant!</b>)';
+$lang['UserAdvManager_Mail_Info_true'] = ' Envoyer un mail à l\'utilisateur reprenant ses infos lors de son inscription ou la mise à jour de son profil.';
+$lang['UserAdvManager_Mail_Info_false'] = ' Désactive l\'envoi de mail d\'info. (valeur par défaut)';
+$lang['UserAdvManager_MailInfo_Text'] = ' Texte utilisé pour l\'introduction du mail envoyé à l\'utilisateur pour son inscription ou la mise à jour de son profil<br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
+$lang['UserAdvManager_No_Casse'] = 'Utilisateur insensible à la casse';
+$lang['UserAdvManager_No_Casse_true'] = ' Rendre le compte utilisateur insensible à la casse, lors de l\'inscription et l\identification.';
+$lang['UserAdvManager_No_Casse_false'] = ' Laisser les utilisateur sensible à la casse. (valeur par défaut)';
+$lang['UserAdvManager_Username_Char'] = 'Caractères limités pour le nom d\'utilisateur';
+$lang['UserAdvManager_Username_Char_true'] = ' Interdire les caractères saisis dans le champs ci-après pour le nom d\'utilisateur lors de l\'inscription == ';
+$lang['UserAdvManager_Username_Char_false'] = ' Laisser le contrôle par défaut du nom d\'utilisateur. (valeur par défaut)';
+$lang['UserAdvManager_Password_Enforced'] = 'Renforcement des mots de passe - Activer cette option rend la saisie du mot de passe obligatoire à l\'inscription des visiteurs. De plus, le mot de passe saisi par le visiteur devra répondre à un score de complexité <b style="color: green;">(activez puis sauvegardez pour afficher plus d\'infos</b>).';
+$lang['UserAdvManager_Password_Enforced_Info'] = '<b style="text-decoration: underline; color: green;">Explications :</b> <b style="color: green;">Le score d\'un mot de passe est calculé en fonction des paramètres de base : longueur, types de caractères utilisés(lettres, chiffres, majuscules, minuscules, caractères spéciaux). Si le mot de passe de l\'utilisateur ne répond pas au score, le score réalisé est affiché ainsi que le score minimum à atteindre et une indication pour augmenter la valeur de ce score. Pour donner un ordre d\'idée, un score inférieur à 100 est considéré comme faible. Entre 100 et 500, la complexité est renforcée et dans la moyenne. Au dela de 500, c\'est Fort Knox !! ;-)<br>Vous pouvez faire vos essais de complexité d\'un mot de passe en utilisant le champ ci-dessous. Cela vous permettra de vous faire une idée du score à définir pour une complexité personnalisée.</b>';
+$lang['UserAdvManager_PasswordTest'] = 'Mot de passe à tester : ';
+$lang['UserAdvManager_ScoreTest'] = 'Score obtenu : ';
+$lang['PasswordTest'] = 'Calcul du score';
+$lang['UserAdvManager_Password_Enforced_true'] = ' Mot de passe renforcé obligatoire - Saisir le score minimum (valeur plancher) de complexité du mots de passe == ';
+$lang['UserAdvManager_Password_Enforced_false'] = ' Ne pas renforcer les mots de passe. (valeur par défaut)';
+$lang['UserAdvManager_AdminPassword_Enforced'] = 'Appliquer également le contrôle du renforcement de mots de passe lorsqu\'un administrateur créé un utilisateur? A noter : Si l\'utilisateur ainsi créé désire changer de mot de passe et que le renforcement des mots de passe pour les utilisateurs est actif, il sera soumis à la règle configurée.';
+$lang['UserAdvManager_AdminPassword_Enforced_true'] = 'Activer le renforcement des mots de passe pour les admins.';
+$lang['UserAdvManager_AdminPassword_Enforced_false'] = 'Désactiver le renforcement des mots de passe pour les admins. (valeur par défaut)';
+$lang['UserAdvManager_Confirm_Mail'] = 'Confirmation de l\'adresse email (<b style="color: green;">activez puis sauvegardez pour afficher le contenu paramétrable du mail</b> - <b style="color: red;">Attention : Si, après configuration, vous désactivez cette option, vous perdrez les personnalisations s\'y afférant!</b>).';
+$lang['UserAdvManager_Confirm_Mail_true'] = ' Envoyer un mail permettant a l\'utilisateur de confirmer son adresse email et donc son compte utilisateur.';
+$lang['UserAdvManager_Confirm_Mail_false'] = ' Système d\'inscription et de mise à jour standard sans confirmation de l\'adresse email. (valeur par défaut)';
+$lang['UserAdvManager_ConfirmMail_Text'] = ' Texte utilisé pour l\'introduction du mail envoyé à l\'utilisateur pour confirmer son adresse mail<br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
+$lang['UserAdvManager_Confirm_Group_Notice'] = 'ATTENTION : L\'utilisation des groupes de validation nécessite que vous ayez créé au moins un groupe d\'utilisateurs et qu\'il soit défini "par défaut" dans la gestion des groupes d\'utilisateurs de Piwigo.';
+$lang['UserAdvManager_No_Confirm_Group'] = 'Groupe à utiliser pour les utilisateurs qui n\'ont pas encore confirmé leur adresse email';
+$lang['UserAdvManager_Validated_Group'] = 'Groupe à utiliser pour les utilisateurs qui ont validé leur adresse email';
+$lang['UserAdvManager_Confirm_Status_Notice'] = 'ATTENTION : L\'utilisation des status de validation nécessite que vous ayez conservé l\'utilisateur "Guest" pour le paramétrage par défaut (modèle) pour les nouveaux inscrits. A noter : Vous pouvez définir n\'importe quel autre utilisateur comme modèle pour les nouveaux inscrits. Reportez-vous à la documentation de Piwigo pour plus de détails.';
+$lang['UserAdvManager_No_Confirm_Status'] = 'Status utilisateur à utiliser pour les utilisateurs qui n\'ont pas encore confirmé leur adresse email';
+$lang['UserAdvManager_Validated_Status'] = 'Status utilisateur à utiliser pour les utilisateurs qui ont validé leur adresse email, laissez ------- pour garder la valuer par défaut de PWG';
+$lang['UserAdvManager_No_Comment_Anonymous'] = 'Pseudo obligatoire sur commentaire';
+$lang['UserAdvManager_No_Comment_Anonymous_true'] = ' Le champs auteur doit être renseigné pour enregistrer un commentaire.';
+$lang['UserAdvManager_No_Comment_Anonymous_false'] = ' Laisser le fonctionnement par défaut pour enregistrer un commentaire. (valeur par défaut)';
+$lang['UserAdvManager_MailExclusion'] = 'Exclusion des domaines de messagerie (<b style="color: green;">activez puis sauvegardez pour afficher le cadre de la liste des exclusions</b> - <b style="color: red;">Attention : Si, après configuration, vous désactivez cette option, vous perdrez les personnalisations s\'y afférant!</b>)';
+$lang['UserAdvManager_MailExclusion_true'] = ' Activer l\'exclusion des domaines de messagerie (par exemple @hotmail.* ou @msn.*)';
+$lang['UserAdvManager_MailExclusion_false'] = ' Désactiver l\'exclusion des domaines de messagerie. (valeur par défaut)';
+$lang['UserAdvManager_MailExclusion_List'] = ' Si l\'exclusion de domaines de messagerie est activée, saisissez les domaines à exclure ici. Il faut respecter le format suivant :<br>@[nom_du_domaine].[extension_du_domaine] - Exemple : @hotmail.com<br><br>Séparez les domaines par une virgule<br>';
+$lang['UserAdvManager_GhostTracker'] = 'Gestion des visiteurs fantômes - Permet de gérer les inscrits en fonction de leur date de dernière visite (<b style="color: green;">activez puis sauvegardez pour afficher plus d\'options</b> - <b style="color: red;">Attention : Si, après configuration, vous désactivez cette option, vous perdrez les personnalisations s\'y afférant!</b>) :';
+$lang['UserAdvManager_GhostTracker_true'] = ' Activer la gestion des visiteurs fantômes.';
+$lang['UserAdvManager_GhostTracker_false'] = ' Désactiver la gestion des visiteurs fantômes. (valeur par défaut)';
+$lang['UserAdvManager_GhostTracker_DayLimit'] = ' Saisissez ici le délai maximum, en jours, entre deux visites d\'un visiteur. Lorsque ce délai est atteind, le visiteur en question apparaitra dans le tableau de l\'onglet "Ghost Tracker".';
+$lang['UserAdvManager_GhostTracker_ReminderText'] = ' Texte utilisé dans le mail de rappel envoyé à l\'utilisateur pour l\'inciter à revenir visiter la galerie (NB: Le texte pré-renseigné à l\'installation du plugin est donné à titre d\'exemple).<br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
+
+
+/* ConfirmMail Configuration Tab */
+$lang['ConfirmMail_Title'] = 'Configuration et gestion avancée de la confirmation par mail';
+$lang['Title_Tab2'] = 'UserAdvManager - Configuration de ConfirmMail';
+$lang['Tab_ConfirmMail'] = 'Configuration de ConfirmMail';
+$lang['UserAdvManager_ConfirmMail_Info'] = 'Limitation du délai de validation de l\'inscription :<br>Si vous activez cette option, sélectionnez le délai (x) )souhaité dans la liste qui suit. Les visiteurs qui s\'inscriront alors auront x jours de délais pour valider leur inscription. Passé ce délai, le lien de validation qu\'ils auront reçu par mail sera expiré.<br>';
+$lang['UserAdvManager_ConfirmMail_TimeOut_true'] = 'Activer la limitation du délai d\'inscription.';
+$lang['UserAdvManager_ConfirmMail_TimeOut_false'] = 'Désactiver la limitation du délai d\'inscription. (valeur par défaut)';
+$lang['UserAdvManager_ConfirmMail_TimeOut'] = 'Délai d\activation :';
+$lang['UserAdvManager_ConfirmMail_Delay_Info'] = 'Saisissez ici le nombre de jours avant expiration de la validation d\'inscription : ';
+$lang['UserAdvManager_ConfirmMail_Remail'] = 'Activer ou désactiver la fonctionnalité de rappel des inscrits non validés :<br>';
+$lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Activer le rappel par mail.';
+$lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Désactiver le rappel par mail. (valeur par défaut)';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Contenu personnalisé du message de rappel avec regénération de clé de validation.<br>Si laissé vide, le mail de rappel ne comportera que le lien de validation. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré-renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible <b>QUE</b> si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Contenu personnalisé du message de rappel sans regénération de clé de validation.<br>Si laissé vide, le mail de rappel sera vide. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré-renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible <b>QUE</b> si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
+
+
+/* UserManager Tab */
+$lang['UserManager_Title'] = 'Gestion avancée des inscrits non validés';
+$lang['Title_Tab3'] = 'UserAdvManager - Gestion des visiteurs';
+$lang['Tab_UserManager'] = 'Gestion des visiteurs';
+$lang['UserAdvManager_ConfirmMail_User_List'] = 'Lorsque la limitation du délai d\'inscription est activée, vous trouverez ci-dessous la liste des utilisateurs en attente de validation d\'inscription <b style="text-decoration: underline;">qu\'ils soient ou pas</b> dans les délais pour la valider.<br><br>Dans cette vue, vous pouvez :
+<br><br>
+- Supprimer manuellement les comptes <b>(purge manuelle)</b>
+<br>
+- Générer l\'email de rappel <b>sans génération</b> d\'une nouvelle clef. Rappel : Cette fonction ne réinitialise pas la date d\'inscription du visiteur ciblé et le délai d\'expiration est toujours d\'actualité.
+<br>
+- Générer l\'email de rappel <b>avec génération</b> d\'une nouvelle clef. Rappel : Cette fonction réinitialise également la date d\'inscription du visiteur ciblé ce qui équivaut à prolonger le délai de validation.<br>
+- Valider manuellement une inscription en attente de validation même si la date d\'expiration est révolue <b>(forçage de la validation)</b>.
+<br>';
+$lang['Registration_Date'] = 'Date d\'enregistrement';
+
+
+/* Ghost Tracker Tab */
+$lang['GhostTracker_Title'] = 'Gestion avancée des visiteurs fantômes';
+$lang['Title_Tab4'] = 'UserAdvManager - Ghost Tracker';
+$lang['Tab_GhostTracker'] = 'Ghost Tracker';
+$lang['UserAdvManager_GhostTracker_User_List'] = 'Lorsque la gestion des visiteurs fantômes est activée, vous trouverez ci-dessous la liste des visiteurs inscrits sur votre galerie et qui ne sont pas revenus depuis x jours. "x" étant le nombre de jours paramétrés dans l\'onglet de configuration générale. De plus, vous trouverez une colonne précisant si un mail de rappel a déjà été envoyé aux visiteurs ciblés, vous permettant de visualiser d\'un coup d\'oeil et traiter les visiteurs qui n\'auraient pas tenu compte du rappel.<br><br>Dans cette vue, vous pouvez :
+<br><br>
+- Supprimer manuellement les comptes <b>(purge manuelle)</b>
+<br>
+- Générer l\'email de rappel <b>avec réinitialisation de la date de dernière visite</b>. Ce qui permet de donner un "joker" au visiteur ciblé. Si le visiteur a déjà bénéficié d\'un mail de rappel, rien n\'empêche de renvoyer un nouveau mail qui réinitialisera, de fait, la date de dernière visite.
+<br>';
+$lang['LastVisit_Date'] = 'Date de dernière visite';
+$lang['Ghost_Reminder'] = 'Email de rappel';
+$lang['Reminder_Sent_OK'] = 'OUI';
+$lang['Reminder_Sent_NOK'] = 'NON';
+
+
+/* Mailing */
+$lang['infos_mail %s'] = '%s, voici vos informations pour vous identifier sur la galerie :';
+$lang['User: %s'] = 'Utilisateur : %s';
+$lang['Password: %s'] = 'Mot de passe: %s';
+$lang['Add of %s'] = 'Création de %s';
+$lang['Update of %s'] = 'Mise à jour de %s';
+$lang['Link: %s'] = 'Cliquez sur le lien suivant pour confirmer votre inscription : %s';
+$lang['Reminder_with_key_of_%s'] = '%s, votre clé de confirmation a été renouvelée';
+$lang['Reminder_without_key_of_%s'] = '%s, votre clé de confirmation va expirer';
+
+
+/* Email confirmation page */
+$lang['title_confirm_mail'] = 'Confirmation de votre inscription';
+$lang['confirm_mail_page_title'] = 'Confirmation d\'inscription';
+$lang['confirm_mail_ok'] = '<br><br><br>Merci d\'avoir confirmé votre mail et aussi et surtout votre inscription sur le site, profitez bien des photos ...<br><br><br><br>';
+$lang['confirm_mail_bad'] = '<br><br><br>Votre clef d\'activation unique est érronée ou expirée ou vous avez déjà validé votre compte, veuillez contacter le webmaster pour régler ce problème.<br><br><br><br>';
+
+
+/* Errors and Warnings */
+$lang['UserAdvManager_audit_ok'] = 'Audit OK';
+$lang['UserAdvManager_save_config'] ='Configuration enregistrée.';
+$lang['Err_audit_no_casse'] = '<b>Ces comptes sont identiques à la casse près :</b> ';
+$lang['Err_audit_username_char'] = '<b>Ce compte contient un ou des caractères interdits :</b> ';
+$lang['Err_audit_email_forbidden'] = '<b>Ce compte contient des domaines de messagerie interdit :</b> ';
+$lang['Err_audit_advise'] = '<b>Vous avez des corrections a faire pour respecter les nouvelles règles que vous avez activées.<br>Utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.</b><br><br>';
+$lang['UserAdvManager_Empty Author'] = 'Le champs auteur doit être rempli pour enregistrer un commentaire.';
+$lang['reg_err_login3'] = 'Sécurité : Le mot de passe est obligatoire !';
+$lang['reg_err_login4_%s'] = 'Sécurité : Un système de contrôle calcule un score de complexité sur les mots de passe choisis. La complexité de votre mot de passe est trop faible (score = %s). Veuillez choisir un nouveau mot de passe plus sûre en respectant les règles suivantes :<br>
+- Utiliser des lettres et des chiffres<br>
+- Utiliser des minuscules et des majuscules<br>
+- Augmenter sa longueur (nombre de caractères)<br>
+Le score minimal des mots de passe imposé par l\'administrateur est de : ';
+if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
+	$lang['reg_err_login5'] = 'ce nom utilisateur est déjà pris, ATTENTION le nom est insensible à la casse (Majuscule = Minuscule).';
+$lang['reg_err_login6'] = 'le nom utilisateur ne doit pas contenir les caractère suivants : ';
+$lang['reg_err_login7'] = 'L\'adresse email est issue d\'un prestataire interdit. Les prestataires d\'adresses email interdits à l\'inscription sont : ';
+$lang['UserAdvManager_empty_pwd'] = '[mot de passe vide]';
+$lang['UserAdvManager_no_update_pwd'] = '[mise à jour du profil sans changement du mot de passe]';
+$lang['invalid_pwd'] = 'Nom utilisateur ou Mot de passe invalide !';
+$lang['Err_ConfirmMail_Settings'] = 'Cette page n\'est accessible que si "Confirmation de l\'adresse email" est actif dans l\'onglet "Configuration Générale".';
+$lang['Err_UserManager_Settings'] = 'Cette page n\'est accessible que si "Délai de validation d\'inscription" est actif dans l\'onglet "Configuration de ConfirmMail" et si un groupe de visiteurs non validés est configuré dans l\'onglet "Configuration Générale".';
+$lang['Err_GhostTracker_Settings'] = 'Cette page n\'est accessible que si "Gestion des visiteurs fantômes" est actif dans l\'onglet "Configuration Générale".';
+$lang['No_validation_for_Guest'] = 'Le compte Guest n\'est pas soumis à validation';
+$lang['No_validation_for_default_user'] = 'Le compte par défaut n\'est pas soumis à validation';
+$lang['No_validation_for_Webmaster'] = 'Le compte du Webmaster n\'est pas soumis à validation';
+$lang['No_validation_for_your_account'] = 'Votre compte d\'admin n\'est pas soumis à validation';
+$lang['Database_Error'] = '<b><u>Attention ! Erreur critique d\'intégrité dans votre base de données.</u></b><br><br>Veuillez contrôler l\'intégrité de la table #_user_confirm_mail.';
+$lang['No_reminder_for_Guest'] = 'Le compte Guest n\'est pas soumis à recevoir des rappels du GhostTracker';
+$lang['No_reminder_for_default_user'] = 'Le compte par défaut n\'est pas soumis à recevoir des rappels du GhostTracker';
+$lang['No_reminder_for_Webmaster'] = 'Le compte du Webmaster n\'est pas soumis à recevoir des rappels du GhostTracker';
+$lang['No_reminder_for_your_account'] = 'Votre compte d\'admin n\'est pas soumis à recevoir des rappels du GhostTracker';
+
+
+/* Processing messages */
+$lang['%d_Mail_With_Key'] = '%d message avec renouvellement de clé a été envoyé';
+$lang['%d_Mails_With_Key'] = '%d messages avec renouvellement de clé ont été envoyés';
+$lang['%d_Reminder_Sent'] = '%d message de rappel a été envoyé';
+$lang['%d_Reminders_Sent'] = '%d messages de rappel ont été envoyés';
+$lang['%d_Validated_User'] = '%d Utilisateur validé manuellement';
+$lang['%d_Validated_Users'] = '%d Utilisateurs validés manuellement';
+
+
+/* Action button names */
+$lang['audit'] = 'Auditer les paramètres';
+$lang['submit'] = 'Sauvegarder les paramètres';
+$lang['Delete_selected'] = 'Supprimer';
+$lang['Mail_without_key'] = 'Rappel sans clé';
+$lang['Mail_with_key'] = 'Rappel avec clé';
+$lang['Force_Validation'] = 'Validation forcée';
+$lang['Reminder_Email'] = 'Email de rappel';
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/language/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/language/index.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/language/index.php	(revision 4144)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/main.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/main.inc.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/main.inc.php	(revision 4144)
@@ -0,0 +1,426 @@
+<?php
+/*
+Plugin Name: NBC UserAdvManager
+Version: 2.12.0
+Description: Permet de renforcer les possibilités de gestion des utilisateurs - Enforce users management
+Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
+Author: Nicco, Eric
+Author URI: http://gallery-nicco.no-ip.org, http://www.infernoweb.net
+*/
+
+/*
+ ***** Plugin history (branch 2.10)*****
+
+-- 2.10.0-beta : Initial beta release for Piwigo compatibility
+-- 2.10.1-beta : Small correction on generated path
+-- 2.10.2-beta : Bug resolved on register validation page
+
+-- 2.10.3 : Final and fully functional release
+						Bug resolved on plugin activation
+
+-- 2.10.4 : Bug fixed on profiles update
+
+-- 2.10.5 : Improved code on profiles update
+
+-- 2.10.6 : Old language packs (iso) deleted (forget from PWG 1.7.x version)
+
+-- 2.10.7 : Bug fixed on user's validation email sending
+
+-- 2.10.8 : ConfirmMail page looks better (Sylvia theme only)
+						Improved code for checking author on guest comments
+
+-- 2.10.9 : Bug fixed - Missing english translation
+						Bug fixed - Notice on forbidden characters function use
+						Bug fixed - Audit on forbidden characters in username didn't work
+						Adding of email provider exclusion (like *@hotmail.com) - Warning ! -> Known bug : This feature doesn't work on user profile page. So, already registered users can change their email address to a forbiden one.
+
+-- 2.10.9a : Email provider exclusion is no longer case sensitive
+
+-- 2.10.9b : Bug fixed - Home icon wasn't linked to gallery url in ConfirmMail page. If GALLERY_URL is not set, Home icon gets the pwg root path.
+
+-- 2.10.9c : Bug fixed - If Email provider exclusion is set off, new registered user will have a PHP notice on "Undefined variable: ncsemail"
+
+-- 2.10.9d : Code simplification - need no more ""template"" sub-directory in plugin directory for enhance "back link" icon in ConfirMail.tpl
+
+-- 2.10.9e : Compatibility improvement with PHP 5.3 - Some old functions will be deprecated like :
+							ereg replaced by preg_match
+							eregi replace by preg_match with "i" moderator
+							split replace by preg_split
+				
+-- 2.10.9f : Compatibility bug fixed when used with DynamicRecentPeriod plugin 
+
+-- 2.11.0 : New tabsheet menu to manage ConfirMail functions (setting a timeout without validation, Cleanup expired user's accounts, Force confirmation, Renew validation key, list unvalidated users,...)
+						Beautify plugin's main admin panel
+						
+-- 2.11.1 : Bug fixed with install and upgrade functions
+						Language files correction
+
+-- 2.11.2 : Bug fixed on bad query for unvalidated users display in unvalidated users list
+						Bug fixed : Sql syntax error on plugin activation
+
+-- 2.11.3 : On Patricia's request (french forum and bug 1173), the unvalidated users management tab shows users according with the settings of unvalidated group and / or unvalidated status.
+						Feature 1172 added : Email providers exclusion list can be set with CR/LF between each entry. The comma seperator (,) is still mandatory.
+						Bug 1175 fixed : Bad translation tag in french language file.
+						Improvement of unvalidated users management tab (feature 1174)- Expired users are displayed in red color text.
+
+-- 2.11.4 : Bug 1177 fixed : Width of excluded email providers list reset to ancient value (80 col)
+						Bug 1179 fixed : Adding a notice in plugin inline documentation for use of validation groups and status. A default group must be set in Piwigo's groups settings and the "Guest" (or another user) must be set as default for status values.
+						Bug 1182 fixed : Language tag missing in confirmation email generation 
+
+-- 2.11.5 : Bug 1195 fixed : Registration displays the good title
+
+-- pre 2.12.0 : Bug 1206 fixed : All plugin functionnalities work in user's profile page
+                Plugin's core code and admin panel refactoring
+                Password control and enforcement : A complexity score is computed on user registration. If this score is less than the goal set by admin, the password choosen is rejected.
+                Feature 1194 "Ghost Tracker" added : New plugin tab displays users who don't comes back to the gallery since x days. Ability to send email reminders and to delete reminded but "dead" users. It's the reason why this feature is called "Ghost Tracker".
+*/
+
+/*
+
+ ***** TODO List *****
+
+++ No validation needed for admins users comments (new trigger needed in comments.php ?)
+
+++ No single email check for admins (new trigger needed in functions_user.inc.php ?)
+
+++ Password control and enforcement
+  ?? Can not be the same as username -> Could password score control be sufficient ? 
+  
+++ Security : Blocking brut-force attacks !
+
+++ Opportunity to copy a registered user for new user creation
+  ++ new copied user will (or not) belong to the same groups
+  ++ new copied user will (or not) get the same status (visitor, admin, webmaster, guest (??))
+  ++ new copied user will (or not) get the same properties
+  ++ new copied user will (or not) get the same language
+  ... and so on
+  
+*/
+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+  die('Hacking attempt!');
+}
+
+define('NBC_UserAdvManager_DIR' , basename(dirname(__FILE__)));
+define('NBC_UserAdvManager_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+include_once (NBC_UserAdvManager_PATH.'include/constants.php');
+include_once (NBC_UserAdvManager_PATH.'include/functions_UserAdvManager.inc.php');
+
+load_language('plugin.lang', NBC_UserAdvManager_PATH);
+
+
+/* Plugin admin */
+add_event_handler('get_admin_plugin_menu_links', 'nbc_UserAdvManager_admin_menu');
+
+function nbc_UserAdvManager_admin_menu($menu)
+{
+  array_push($menu,
+    array(
+      'NAME' => 'UserAdvManager',
+      'URL'  => get_admin_plugin_menu_link(NBC_UserAdvManager_PATH.'/admin/UserAdvManager_admin.php')
+    )
+  );
+
+  return $menu;
+}
+
+
+add_event_handler('loc_begin_index', 'UserAdvManager_GhostTracker');
+
+function UserAdvManager_GhostTracker()
+{
+  global $conf, $user;
+  
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+  if (isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[17] == 'true' and !is_admin() and !is_a_guest())
+  {
+
+    $userid = get_userid($user['username']);
+     	  
+    /* Looking for existing entry in last visit table */
+    $query = '
+SELECT *
+FROM '.USER_LASTVISIT_TABLE.'
+WHERE user_id = '.$userid.'
+;';
+        
+    $count = mysql_num_rows(pwg_query($query));
+         
+    if ($count == 0)
+    {
+      /* If not, data are inserted in table */
+      $query = '
+INSERT INTO '.USER_LASTVISIT_TABLE.' (user_id, lastvisit, reminder)
+VALUES ('.$userid.', now(), "false")
+;';
+      pwg_query($query);
+    }
+    else if ($count > 0)
+    {
+      /* If yes, data are updated in table */
+      $query = '
+UPDATE '.USER_LASTVISIT_TABLE.'
+SET lastvisit = now(), reminder = "false"
+WHERE user_id = '.$userid.'
+LIMIT 1
+;';
+      pwg_query($query);
+    }
+  }
+}
+
+
+/* User creation */
+add_event_handler('register_user', 'UserAdvManager_Adduser');
+
+function UserAdvManager_Adduser($register_user)
+{
+  global $conf;
+  
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  
+  /* Sending registration confirmation by email */
+  if ((isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))
+  {
+    SendMail2User(1, $register_user['id'], $register_user['username'], $_POST['password'], $register_user['email'], true);
+  }
+}
+
+
+
+/* User deletion */
+add_event_handler('delete_user', 'UserAdvManager_Deluser');
+
+function UserAdvManager_Deluser($user_id)
+{
+  DeleteConfirmMail($user_id);
+}
+
+
+/* Check users registration */
+add_event_handler('register_user_check', 'UserAdvManager_RegistrationCheck', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+
+function UserAdvManager_RegistrationCheck($err, $user)
+{
+  global $errors, $conf;
+
+  $PasswordCheck = 0;
+  
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+  /* Password enforcement control */
+  if (isset($conf_nbc_UserAdvManager[14]) and $conf_nbc_UserAdvManager[14] == 'true' and !empty($conf_nbc_UserAdvManager[15]))
+  {
+    if (!empty($user['password']) and !is_admin())
+    {
+      $PasswordCheck = testpassword($user['password']);
+  
+      if ($PasswordCheck < $conf_nbc_UserAdvManager[15])
+      {
+        $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
+        return($lang['reg_err_pass'] = l10n_args($message).$conf_nbc_UserAdvManager[15]);
+      }
+    }
+    else if (!empty($user['password']) and is_admin() and isset($conf_nbc_UserAdvManager[16]) and $conf_nbc_UserAdvManager[16] == 'true')
+    { 
+      $PasswordCheck = testpassword($user['password']);
+  
+      if ($PasswordCheck < $conf_nbc_UserAdvManager[15])
+      {
+        $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
+        return($lang['reg_err_pass'] = l10n_args($message).$conf_nbc_UserAdvManager[15]);
+      }
+    }
+  }
+
+  /* Username non case sensitive */
+  if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true')
+  {
+    $new_username =  NotSensibleSearchUsername($_POST['login']);
+    $_POST['login'] = $new_username == '' ? $_POST['login'] : $new_username;
+  }
+
+  /* Username without forbidden keys */
+  if (isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' and !empty($_POST['login']) and !ValidateUsername($_POST['login']))
+  {
+    $_POST['login'] = '';
+    return($lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_nbc_UserAdvManager[8]."'");
+  }
+
+  /* Email without forbidden domains */
+  if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address']))
+  {
+    $_POST['login'] = '';
+    return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+  }
+}
+
+
+if (script_basename() == 'profile')
+{
+  add_event_handler('loc_begin_profile', 'UserAdvManager_Profile_Init');
+
+  function UserAdvManager_Profile_Init()
+  {
+    global $conf, $user, $template;
+
+    $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+    if (isset($_POST['validate']))
+    {
+      /* Email without forbidden domains */
+      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+      {
+        if (!ValidateEmailProvider($_POST['mail_address']))
+        {
+          $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+          unset($_POST['validate']);
+        }
+      }
+
+      $typemail = 3;
+      
+      if (!empty($_POST['use_new_pwd']))
+      {
+        $typemail = 2;
+        
+        /* Password enforcement control */
+        if (isset($conf_nbc_UserAdvManager[14]) and $conf_nbc_UserAdvManager[14] == 'true' and !empty($conf_nbc_UserAdvManager[15]))
+        {
+          $PasswordCheck = testpassword($_POST['use_new_pwd']);
+         
+          if ($PasswordCheck < $conf_nbc_UserAdvManager[15])
+          {
+            $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
+            $template->append('errors', l10n_args($message).$conf_nbc_UserAdvManager[15]);
+            unset($_POST['use_new_pwd']);
+            unset($_POST['validate']);
+          }
+        }
+      }
+      
+      /* Sending registration confirmation by email */
+      if (( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))
+      {
+        $confirm_mail_need = false;
+              
+        if (!empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']))
+        {
+          $query = '
+SELECT '.$conf['user_fields']['email'].' AS email
+FROM '.USERS_TABLE.'
+WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+;';
+          
+          list($current_email) = mysql_fetch_row(pwg_query($query));
+      
+          if ( $_POST['mail_address'] != $current_email and ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true') )
+        
+            $confirm_mail_need = true;
+        }
+        
+        if ((!empty($_POST['use_new_pwd']) and ( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or $confirm_mail_need) )
+        {
+          $query = '
+SELECT '.$conf['user_fields']['username'].'
+FROM '.USERS_TABLE.'
+WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+;';
+        
+          list($username) = mysql_fetch_row(pwg_query($query));
+
+          SendMail2User($typemail, $user['id'], $username, $_POST['use_new_pwd'], $_POST['mail_address'], $confirm_mail_need);
+        }
+      }
+    }
+  }
+}
+
+
+add_event_handler('init', 'UserAdvManager_InitPage');
+ 
+function UserAdvManager_InitPage()
+{
+  load_language('plugin.lang', NBC_UserAdvManager_PATH);
+  global $conf, $template, $page, $lang, $errors;
+
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  
+  /* Username non case sensitive */
+  if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true')
+  {
+    $lang['reg_err_login5'] = l10n('reg_err_login5');
+  }
+  
+
+ 
+/* User identification */
+  if (script_basename() == 'identification')
+  {
+    if (isset($_POST['login']))
+    {
+      /* User non case sensitive */
+      if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' )
+      {
+        $new_username =  NotSensibleSearchUsername($_POST['username']);
+        $_POST['username'] = $new_username == '' ? $_POST['username'] : $new_username;
+      }
+    }
+  }
+
+
+/* Admin user management */
+  if (script_basename() == 'admin' and isset($_GET['page']) and $_GET['page'] == 'user_list')
+  {
+    if (isset($_POST['submit_add']))
+    {
+      /* User non case sensitive */
+      if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' )
+      {
+        $new_username =  NotSensibleSearchUsername($_POST['login']);
+        $_POST['login'] = $new_username == '' ? $_POST['login'] : $new_username;
+      }
+
+      /* Username without forbidden keys */
+      if (isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' and !empty($_POST['login']) and !ValidateUsername($_POST['login']))
+      {
+        $template->append('errors', l10n('reg_err_login6')."'".$conf_nbc_UserAdvManager[8]."'");
+        unset($_POST['submit_add']);
+      }
+
+      /* Email without forbidden domains */
+      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email']))
+      {
+        $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+        unset($_POST['submit_add']);
+      }
+    }
+  }
+}
+
+
+add_event_handler('user_comment_check', 'UserAdvManager_CheckEmptyCommentAuthor', 50, 2);
+
+function UserAdvManager_CheckEmptyCommentAuthor($comment_action, $comm)
+{
+  load_language('plugin.lang', NBC_UserAdvManager_PATH);
+  global $infos, $conf, $template;
+
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+/* User creation OR update */
+  if (isset($conf_nbc_UserAdvManager[6]) and $conf_nbc_UserAdvManager[6] == 'true' and $conf['comments_forall'] == 'true' and $comm['author'] == 'guest')
+  {
+    $comment_action = 'reject';
+
+    array_push($infos, l10n('UserAdvManager_Empty Author'));
+  }
+
+  return $comment_action;
+}
+
+?>
Index: /extensions/NBC_UserAdvManager/branches/2.12/maintain.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.12/maintain.inc.php	(revision 4144)
+++ /extensions/NBC_UserAdvManager/branches/2.12/maintain.inc.php	(revision 4144)
@@ -0,0 +1,182 @@
+<?php
+
+if(!defined("NBC_UserAdvManager_PATH"))
+  define('NBC_UserAdvManager_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+include_once (NBC_UserAdvManager_PATH.'include/constants.php');
+include_once (NBC_UserAdvManager_PATH.'include/functions_UserAdvManager.inc.php');
+
+function plugin_install()
+{
+	global $conf;
+	
+  $q = '
+INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+VALUES ("nbc_UserAdvManager","true;false;false;-1;-1;-1;false;false;;-1;;;false;;false;100;false,false,10,Hello.
+	
+This is a reminder because a very long time passed since your last visit on our gallery. If you do not want anymore to use your access account, please let us know by replying to this email. Your account will be deleted.
+
+On receipt of this message and no new visit within 15 days, we would be obliged to automatically delete your account.
+
+Best regards,
+
+The admin of the gallery.","Parametres du plugin nbc UserAdvManager")
+  ;';
+  pwg_query($q);
+
+  $q = '
+INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;Hello.
+		
+This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You have again 5 days to validate your registration.
+
+Note: After this period, your account will be permanently deleted.;false;Hello.
+
+This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key will expire. To allow you access to our gallery, you have 2 days to confirm your registration by clicking on the link in the message you should have received when you registered.
+
+Note: After this period, your account will be permanently deleted.","Parametres nbc_UserAdvManager - ConfirmMail")
+  ;';
+  pwg_query($q);
+
+	$q = "
+CREATE TABLE IF NOT EXISTS ".USER_CONFIRM_MAIL_TABLE." (
+  id varchar(50) NOT NULL default '',
+  user_id smallint(5) NOT NULL default '0',
+  mail_address varchar(255) default NULL,
+  status enum('webmaster','admin','normal','generic','guest') default NULL,
+  date_check datetime default NULL,
+PRIMARY KEY  (id)
+  )
+;";
+  pwg_query($q);
+
+	$q = "
+CREATE TABLE IF NOT EXISTS ".USER_LASTVISIT_TABLE." (
+  user_id SMALLINT(5) NOT NULL DEFAULT '0',
+  lastvisit DATETIME NULL DEFAULT NULL,
+  reminder ENUM('true','false') NULL,
+PRIMARY KEY (`user_id`)
+  )
+;";
+  pwg_query($q);
+}
+
+function plugin_activate()
+{
+	  global $conf;
+	
+/* Check for upgrade from 2.10 */
+	  $query = '
+SELECT *
+FROM '.CONFIG_TABLE.'
+WHERE param = "nbc_UserAdvManager_ConfirmMail"
+;';
+  $count = mysql_num_rows(pwg_query($query)); 
+  
+  /* upgrade from branch 2.10 */
+	if ($count == 0)
+	{
+		upgrade_210();
+	}
+
+/* Check for upgrade from 2.11 */
+  if (!table_exist(USER_LASTVISIT_TABLE))
+  {
+    /* upgrade from branch 2.11 */
+		upgrade_211();
+  }
+}
+
+
+function plugin_uninstall()
+{
+  global $conf;
+
+  if (isset($conf['nbc_UserAdvManager']))
+  {
+    $q = '
+DELETE FROM '.CONFIG_TABLE.'
+WHERE param="nbc_UserAdvManager"
+;';
+
+    pwg_query($q);
+  }
+
+  if (isset($conf['nbc_UserAdvManager_ConfirmMail']))
+  {
+    $q = '
+DELETE FROM '.CONFIG_TABLE.'
+WHERE param="nbc_UserAdvManager_ConfirmMail"
+;';
+
+    pwg_query($q);
+  }
+
+  $q = 'DROP TABLE '.USER_CONFIRM_MAIL_TABLE.';';
+  pwg_query( $q );
+
+  $q = 'DROP TABLE '.USER_LASTVISIT_TABLE.';';
+  pwg_query( $q );
+}
+
+/* upgrade from branch 2.10 */
+function upgrade_210()
+{
+	global $conf;
+	  
+  $q = '
+INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;Hello.
+		
+This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You have again 5 days to validate your registration.
+
+Note: After this period, your account will be permanently deleted.;false;Hello.
+
+This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key will expire. To allow you access to our gallery, you have 2 days to confirm your registration by clicking on the link in the message you should have received when you registered.
+
+Note: After this period, your account will be permanently deleted.","Parametres nbc_UserAdvManager - ConfirmMail")
+  ;';
+  pwg_query($q);
+
+upgrade_211();
+}
+
+/* upgrade from branch 2.11 */
+function upgrade_211()
+{
+	global $conf;
+
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+  if ((!isset($conf_nbc_UserAdvManager[14]) and !isset($conf_nbc_UserAdvManager[15])) and !isset($conf_nbc_UserAdvManager[16]) and !isset($conf_nbc_UserAdvManager[17]))
+  {
+    $upgrade_nbc_UserAdvManager = $conf_nbc_UserAdvManager[0].';'.$conf_nbc_UserAdvManager[1].';'.$conf_nbc_UserAdvManager[2].';'.$conf_nbc_UserAdvManager[3].';'.$conf_nbc_UserAdvManager[4].';'.$conf_nbc_UserAdvManager[5].';'.$conf_nbc_UserAdvManager[6].';'.$conf_nbc_UserAdvManager[7].';'.$conf_nbc_UserAdvManager[8].';'.$conf_nbc_UserAdvManager[9].';'.$conf_nbc_UserAdvManager[10].';'.$conf_nbc_UserAdvManager[11].';'.$conf_nbc_UserAdvManager[12].';'.$conf_nbc_UserAdvManager[13].';false;100;false;false;10;Hello.
+	
+This is a reminder because a very long time passed since your last visit on our gallery. If you do not want anymore to use your access account, please let us know by replying to this email. Your account will be deleted.
+
+On receipt of this message and no new visit within 15 days, we would be obliged to automatically delete your account.
+
+Best regards,
+
+The admin of the gallery.';
+		
+		$query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$upgrade_nbc_UserAdvManager.'"
+WHERE param="nbc_UserAdvManager"
+LIMIT 1
+;';
+		pwg_query($query);
+  }
+  
+	$q = "
+CREATE TABLE IF NOT EXISTS ".USER_LASTVISIT_TABLE." (
+  user_id SMALLINT(5) NOT NULL DEFAULT '0',
+  lastvisit DATETIME NULL DEFAULT NULL,
+  reminder ENUM('true','false') NULL,
+PRIMARY KEY (`user_id`)
+  )
+;";
+  pwg_query($q);
+}
+?>
