Index: /extensions/NBC_UserAdvManager/tags/2.11.1/ConfirmMail.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/ConfirmMail.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/ConfirmMail.php	(revision 3875)
@@ -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/tags/2.11.1/ConfirmMail.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/ConfirmMail.tpl	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/ConfirmMail.tpl	(revision 3875)
@@ -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/tags/2.11.1/admin/UserAdvManager_admin.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/admin/UserAdvManager_admin.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/admin/UserAdvManager_admin.php	(revision 3875)
@@ -0,0 +1,900 @@
+<?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->select($page['tab']);
+$tabsheet->assign();
+
+$page['global'] = array();
+$error = array();
+
+// +-----------------------------------------------------------------------+
+// |                            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']) )
+  {
+		$_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text']));
+		$_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text']));
+		
+		$newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'];
+		
+		$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'));
+  }
+	
+  $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],
+    )
+  );
+	
+
+  if ( isset($_POST['audit']) or isset($_POST['submit']) )
+	{
+		$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_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');
+              
+			if (isset($conf_nbc_UserAdvManager_ConfirmMail[1]) and $conf_nbc_UserAdvManager_ConfirmMail[0]=='true' )
+    	{
+    		$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'],
+					)
+				);
+			}
+		}
+
+// +-----------------------------------------------------------------------+
+// |                             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; 
+}
+?>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/admin/confirmmail.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/admin/confirmmail.tpl	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/admin/confirmmail.tpl	(revision 3875)
@@ -0,0 +1,44 @@
+<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/tags/2.11.1/admin/global.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/admin/global.tpl	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/admin/global.tpl	(revision 3875)
@@ -0,0 +1,70 @@
+<div class="titrePage">
+  <h2>{'Title_Tab1'|@translate}</h2>
+</div>
+
+<form method="post" action="{$UserAdvManager_F_ACTION}" class="general">
+  <fieldset>
+  	<legend>{'UserAdvManager_Title'|@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>
+    	<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>
+    	<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_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>
+    	<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>
+    	<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>
+    	<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>
+    	<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>
+    	<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>
+    	</li>
+    </ul>
+  	<p><input class="submit" type="submit" value="{'audit'|@translate}" name="audit" />&nbsp;<input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} /></p>
+  </fieldset>
+</form>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/admin/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/admin/index.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/admin/index.php	(revision 3875)
@@ -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/tags/2.11.1/admin/usermanager.tpl
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/admin/usermanager.tpl	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/admin/usermanager.tpl	(revision 3875)
@@ -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'|@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 style="text-align:center;">{$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/tags/2.11.1/include/constants.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/include/constants.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/include/constants.php	(revision 3875)
@@ -0,0 +1,4 @@
+<?php
+global $prefixeTable;
+define('USER_CONFIRM_MAIL_TABLE', $prefixeTable.'user_confirm_mail');
+?>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/include/functions_UserAdvManager.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/include/functions_UserAdvManager.inc.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/include/functions_UserAdvManager.inc.php	(revision 3875)
@@ -0,0 +1,681 @@
+<?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;
+  $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 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 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)
+						{
+							$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) // Change user's group 
+						{
+							$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']))) // 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 : '';
+  }
+}
+
+
+/* Obsolete function - Check for single email in database */
+function SearchMail($email)
+{
+  global $conf, $lang;
+  
+  if (isset($email))
+  {
+    $query = "
+      SELECT COUNT(*)
+      FROM ".USERS_TABLE."
+      WHERE ".$conf['user_fields']['email']." = '".$email."'
+    ;";
+    list($nbr_mail) = mysql_fetch_row(pwg_query($query));
+  
+    return isset($nbr_mail) ? $nbr_mail : 0;
+  }
+}
+
+
+/* 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;
+  }
+}
+
+
+/* Obsolete function - Check for no forbidden email provider */
+/* This don't work on function call */
+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,
+                    ug.group_id
+		FROM '.USERS_TABLE.' AS u
+		INNER JOIN '.USER_INFOS_TABLE.' AS ui
+			ON u.'.$conf['user_fields']['id'].' = ui.user_id
+ 		INNER JOIN '.USER_GROUP_TABLE.' AS ug
+    	ON u.'.$conf['user_fields']['id'].' = ug.user_id
+  	WHERE u.'.$conf['user_fields']['id'].' >= 0
+    	AND ug.group_id = "'.$conf_nbc_UserAdvManager[3].'"
+      AND TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'"
+		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;
+}
+?>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/include/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/include/index.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/include/index.php	(revision 3875)
@@ -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/tags/2.11.1/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/index.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/index.php	(revision 3875)
@@ -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/tags/2.11.1/language/en_UK/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/index.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/index.php	(revision 3875)
@@ -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/tags/2.11.1/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/plugin.lang.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/plugin.lang.php	(revision 3875)
@@ -0,0 +1,132 @@
+<?php
+
+global $lang,$conf;
+
+$conf_UserAdvManager = isset($conf['UserAdvManager']) ? explode(";" , $conf['UserAdvManager']) : array();
+
+
+/* Global Configuration Tab */
+$lang['Title_Tab1'] = 'UserAdvManager - Global Configuration';
+$lang['Tab_Global'] = 'Global Configuration';
+$lang['UserAdvManager_Title'] = 'Advanced users settings';
+$lang['UserAdvManager_Mail_Info'] = ' Mail information user';
+$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.';
+$lang['UserAdvManager_MailInfo_Text'] = ' Text used to introduce the email sent to user on his registration or at his profile update.<br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
+$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.';
+$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.';
+$lang['UserAdvManager_Confirm_Mail'] = 'Email address confirmation';
+$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).';
+$lang['UserAdvManager_ConfirmMail_Text'] = 'Text used to introduce the email sent to user to allow him to validate his email address<br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
+$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_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.';
+$lang['UserAdvManager_MailExclusion'] = 'Email provider exclusion';
+$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.';
+$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['audit'] = 'Audit';
+$lang['submit'] = 'Submit';
+
+
+/* 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.';
+$lang['UserAdvManager_ConfirmMail_TimeOut'] = 'Validation delay :';
+$lang['UserAdvManager_ConfirmMail_Delay_Info'] = 'Enter the number of days before expiry of the registration validation : ';
+/* This function can't work due to no access to server's cron functionnalities */
+//$lang['UserAdvManager_ConfirmMail_AutoDel'] = 'Suppression automatique des comptes non validés après le délai d\'expiration : ';
+//$lang['UserAdvManager_ConfirmMail_AutoDel_true'] = 'Activer la suppression automatique - <b style="text-decoration: blink underline;">ATTENTION !</b> La suppression est aveugle et sans notification.';
+//$lang['UserAdvManager_ConfirmMail_AutoDel_false'] = 'Désactiver la suppression automatique.';
+$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';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Custom content of the recall message with regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Text modification is available <b>ONLY</b> if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Custom content of the recall message without regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Text modification is available <b>ONLY</b> if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
+
+
+/* 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'] = 'Registration date';
+
+
+/* Mailing */
+$lang['infos_mail %s'] = '%s, please find here your information to login the gallery :';
+$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';
+
+
+/* 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.';
+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 tab "Global Configuration".';
+$lang['Err_UserManager_Settings'] = 'This page is available only if "Enable limiting the registration deadline" is active in the "ConfirmMail Settings" tab.';
+$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.';
+
+
+/* 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['Delete_selected'] = 'Delete';
+$lang['Mail_without_key'] = 'Reminder without key';
+$lang['Mail_with_key'] = 'Reminder with key';
+$lang['Force_Validation'] = 'Forced validation';
+?>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/index.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/index.php	(revision 3875)
@@ -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/tags/2.11.1/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/plugin.lang.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/plugin.lang.php	(revision 3875)
@@ -0,0 +1,132 @@
+<?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_Title'] = 'Configuration avancée des utilisateurs';
+$lang['UserAdvManager_Mail_Info'] = 'Mail d\'information à l\'utilisateur';
+$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.';
+$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="text-decoration: blink underline;">ATTENTION !</b> Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
+$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.';
+$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.';
+$lang['UserAdvManager_Confirm_Mail'] = 'Confirmation de l\'adresse email';
+$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.';
+$lang['UserAdvManager_ConfirmMail_Text'] = 'Texte utilisé pour l\'introduction du mail envoyé à l\'utilisateur pour confirmer son adresse mail<br>(!!! <b style="text-decoration: blink underline;">ATTENTION !</b> Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
+$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_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.';
+$lang['UserAdvManager_MailExclusion'] = 'Exclusion des domaines de messagerie';
+$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.';
+$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['audit'] = 'Audit';
+$lang['submit'] = 'Valider';
+
+
+/* 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.';
+$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 : ';
+/* This function can't work due to no access to server's cron functionnalities */
+//$lang['UserAdvManager_ConfirmMail_AutoDel'] = 'Suppression automatique des comptes non validés après le délai d\'expiration : ';
+//$lang['UserAdvManager_ConfirmMail_AutoDel_true'] = 'Activer la suppression automatique - <b style="text-decoration: blink underline;">ATTENTION !</b> La suppression est aveugle et sans notification.';
+//$lang['UserAdvManager_ConfirmMail_AutoDel_false'] = 'Désactiver la suppression automatique.';
+$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';
+$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="text-decoration: blink underline;">ATTENTION !</b> 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é !!!)';
+$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="text-decoration: blink underline;">ATTENTION !</b> 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é !!!)';
+
+
+/* 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 d\'enregistrement';
+
+
+/* Mailing */
+$lang['infos_mail %s'] = '%s, voici vos informations pour vous identifier sur la galerie :';
+$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é<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>';
+$lang['UserAdvManager_Empty Author'] = 'Le champs auteur doit être rempli pour enregistrer un commentaire.';
+if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
+	$lang['new_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".';
+$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.';
+
+
+/* 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['Delete_selected'] = 'Supprimer';
+$lang['Mail_without_key'] = 'rappel sans clé';
+$lang['Mail_with_key'] = 'rappel avec clé';
+$lang['Force_Validation'] = 'Validation forcée';
+?>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/language/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/index.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/index.php	(revision 3875)
@@ -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/tags/2.11.1/main.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/main.inc.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/main.inc.php	(revision 3875)
@@ -0,0 +1,407 @@
+<?php
+/*
+Plugin Name: NBC UserAdvManager
+Version: 2.11.1
+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
+
+*/
+
+/*
+
+ ***** 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
+  -- Empty password (done in Piwigo 2.x)
+  ++ Can not be the same as username
+  ++ complexity of the password (Numbers+Lettrers+Low and high case+Special+minimal length)
+  
+++ 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;
+}
+
+
+
+/* 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();
+
+  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);
+
+}
+
+
+
+add_event_handler('init', 'UserAdvManager_InitPage');
+ 
+function UserAdvManager_InitPage()
+{
+  load_language('plugin.lang', NBC_UserAdvManager_PATH);
+  global $conf, $template, $page, $lang;
+
+  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+  
+
+  if ( isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' )
+    $lang['reg_err_login5'] = l10n('new_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']))
+      {
+        $lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_nbc_UserAdvManager[8]."'";
+        $_POST['login'] = '';
+      }
+
+      /* Email without forbidden domains */
+      /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
+      //if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email']))
+      //{
+      //  $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+	  //  $_POST['login'] = '';
+	  //}
+      /* This work with a code copy of ValidateEmailProvider() function */
+			if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']))
+			{
+		  	$ncsemail = strtolower($_POST['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))
+	    		{
+		      	$lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+		        $_POST['login'] = '';
+					}
+				}
+			}
+    }
+  }
+
+/* User creation */
+  if (script_basename() == 'register')
+  {
+    if (isset($_POST['submit']))
+    {
+      /* 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']))
+      {
+        $lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_nbc_UserAdvManager[8]."'";
+        $_POST['login'] = '';
+      }
+
+
+      /* Email without forbidden domains */
+      /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
+      //if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address']))
+      //{
+      //  $lang['reg_err_mail_address'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+      //  $_POST['mail_address'] = '';
+      //}
+      /* This work with a code copy of ValidateEmailProvider() function */
+			if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+		  {
+		  	$ncsemail = strtolower($_POST['mail_address']);
+		    $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))
+				  {
+				  	$lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+						$_POST['login'] = '';
+				  }
+			  }
+		  }
+    }
+  }
+
+/* User profile update */
+  if (script_basename() == 'profile')
+  {
+    if (isset($_POST['validate']))
+    {
+      /* Sending email to user */
+      if (( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))
+      {
+      	global $conf, $user ;
+        $errors = array();
+  
+        $int_pattern = '/^\d+$/';
+        if (empty($_POST['nb_image_line'])
+            or (!preg_match($int_pattern, $_POST['nb_image_line'])))
+        {
+          $errors[] = l10n('nb_image_line_error');
+        }
+      
+        if (empty($_POST['nb_line_page'])
+            or (!preg_match($int_pattern, $_POST['nb_line_page'])))
+        {
+          $errors[] = l10n('nb_line_page_error');
+        }
+      
+        if ($_POST['maxwidth'] != ''
+            and (!preg_match($int_pattern, $_POST['maxwidth'])
+                 or $_POST['maxwidth'] < 50))
+        {
+          $errors[] = l10n('maxwidth_error');
+        }
+        if ($_POST['maxheight']
+             and (!preg_match($int_pattern, $_POST['maxheight'])
+                   or $_POST['maxheight'] < 50))
+        {
+          $errors[] = l10n('maxheight_error');
+        }
+
+        if (isset($_POST['mail_address']))
+        {
+          $mail_error = validate_mail_address($user['id'], $_POST['mail_address']);
+          if (!empty($mail_error))
+          {
+            $errors[] = $mail_error;
+          }
+          
+					if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+		  		{
+		  			$ncsemail = strtolower($_POST['mail_address']);
+		    		$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))
+				  		{
+				    		$mail_error = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+				  		}
+			  		}
+		  		}
+	      	if (!empty($mail_error))
+          {
+            $errors[] = $mail_error;
+          }
+        }
+
+        $typemail = 3;
+        
+        if (!empty($_POST['use_new_pwd']))
+        {
+          $typemail = 2;
+
+          // password must be the same as its confirmation
+          if ($_POST['use_new_pwd'] != $_POST['passwordConf'])
+          {
+            $errors[] = l10n('New password confirmation does not correspond');
+          }
+      
+          if ( !defined('IN_ADMIN') )
+          {// changing password requires old password
+            $query = '
+              SELECT '.$conf['user_fields']['password'].' AS password
+              FROM '.USERS_TABLE.'
+              WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+            ;';
+            list($current_password) = mysql_fetch_row(pwg_query($query));
+        
+            if ($conf['pass_convert']($_POST['password']) != $current_password)
+            {
+              $errors[] = l10n('Current password is wrong');
+            }
+          }
+        }
+        
+        $confirm_mail_need = false;
+              
+        if (!empty($_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 (count($errors) == 0 and (!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('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/tags/2.11.1/maintain.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/maintain.inc.php	(revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/maintain.inc.php	(revision 3875)
@@ -0,0 +1,117 @@
+<?php
+
+if(!defined("NBC_UserAdvManager_PATH"))
+  define('NBC_UserAdvManager_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+include_once (NBC_UserAdvManager_PATH.'include/constants.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;;","Parametres du plugin nbc UserAdvManager")
+  ;';
+  pwg_query($q);
+
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+    VALUES ("nbc_UserAdvManager_ConfirmMail","true;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.;true;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);
+}
+
+function plugin_activate()
+{
+	  global $conf;
+	
+/* Check for upgrade */
+	  $query = '
+    SELECT *, COUNT (*)
+		FROM '.CONFIG_TABLE.'
+    WHERE param = "nbc_UserAdvManager_ConfirmMail"
+  ;';
+  list($count) = mysql_fetch_row(pwg_query($query)); 
+  
+  /* upgrade from branch 2.10 */
+	if ($count == 0)
+	{
+		upgrade_UserAdvManager();
+	}
+}
+
+function plugin_uninstall()
+{
+  global $conf;
+
+  if (isset($conf['nbc_UserAdvManager']))
+  {
+    $q = '
+      DELETE FROM '.CONFIG_TABLE.'
+      WHERE param="nbc_UserAdvManager"
+    ;';
+
+    pwg_query($q);
+  }
+
+
+  $q = 'DROP TABLE '.USER_CONFIRM_MAIL_TABLE.';';
+  pwg_query( $q );
+}
+
+function upgrade_UserAdvManager()
+{
+	global $conf;
+	  
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+    VALUES ("nbc_UserAdvManager_ConfirmMail","true;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.;true;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);
+}
+?>
