Index: extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 3846)
+++ extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 3858)
@@ -48,7 +48,9 @@
 switch ($page['tab'])
 {
+// *************************************************************************
 // +-----------------------------------------------------------------------+
 // |                           Global Config                               |
 // +-----------------------------------------------------------------------+
+// *************************************************************************
   case 'global':
 	
@@ -135,4 +137,5 @@
 	    $No_Valid_Status = $status;
 	  }
+	  
 /* Template initialization for unvalidated users group */
       $template->assign(
@@ -144,4 +147,5 @@
 	  		);
   }
+  
 /* Get status values */
   foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
@@ -152,4 +156,5 @@
 		  $Valid_Status = $status;
 		}
+		
 /* Template initialization for unvalidated users group */
       $template->assign(
@@ -189,5 +194,5 @@
 
   if ( isset($_POST['audit']) or isset($_POST['submit']) )
-  {
+	{
 		$msg_error1 = '';
 		
@@ -217,60 +222,60 @@
 		
 /* 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."
-				;";
+    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);
+			$result = pwg_query($query);
 			
-			  while($row = mysql_fetch_array($result))
+			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++)
 			  {
-					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'].')';
-						}
+					$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'));
+		}
+		
+    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'));
 	}
 
@@ -296,7 +301,9 @@
   break;
 
+// *************************************************************************
 // +-----------------------------------------------------------------------+
 // |                           ConfirmMail Config                          |
 // +-----------------------------------------------------------------------+
+// *************************************************************************
   case 'confirmmail':
 	
@@ -345,12 +352,12 @@
 // |                             errors display                            |
 // +-----------------------------------------------------------------------+
-	if ( isset ($errors) and count($errors) != 0)
-	{
-	  $template->assign('errors',array());
-		foreach ($errors as $error)
-	  {
-			array_push($page['errors'], $error);
-	  }
- 	}  
+		if ( isset ($errors) and count($errors) != 0)
+		{
+	  	$template->assign('errors',array());
+			foreach ($errors as $error)
+	  	{
+				array_push($page['errors'], $error);
+	  	}
+ 		}  
 
 // +-----------------------------------------------------------------------+
@@ -367,8 +374,11 @@
 
 
+// *************************************************************************
 // +-----------------------------------------------------------------------+
 // |                           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();
@@ -380,5 +390,5 @@
 // +-----------------------------------------------------------------------+
 
-	if (!defined('PHPWG_ROOT_PATH'))
+		if (!defined('PHPWG_ROOT_PATH'))
     {
     	die('Hacking attempt!');
@@ -390,5 +400,5 @@
 // | Check Access and exit when user status is not ok                      |
 // +-----------------------------------------------------------------------+
-	check_status(ACCESS_ADMINISTRATOR);
+		check_status(ACCESS_ADMINISTRATOR);
 
     $page['order_by_items'] = array(
@@ -403,259 +413,338 @@
 // +-----------------------------------------------------------------------+
 
-	$page['filtered_users'] = get_unvalid_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'));
-    }
-	}
+		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]);
-        }
-      }
-		}
-	}
-
+		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'));
-    }
-	}
+		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."'
+		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));
+					$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)
-        )
-      );
-
-      foreach ($page['filtered_users'] as $filter_key => $filter_user)
-      {
-      	if (in_array($filter_user['id'], $collection))
-        {
-        	unset($page['filtered_users'][$filter_key]);
-        }
-			}
-		}
-	}
-
+      		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'));
-    }
-	}
+		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));
+		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)
-        )
-      );
-
-      foreach ($page['filtered_users'] as $filter_key => $filter_user)
-      {
-      	if (in_array($filter_user['id'], $collection))
-        {
-        	unset($page['filtered_users'][$filter_key]);
-        }
-			}
-		}
-	}
+      		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();
+			}
+		}
 
 // +-----------------------------------------------------------------------+
@@ -663,5 +752,5 @@
 // +-----------------------------------------------------------------------+
 
-	$groups[-1] = '------------';
+		$groups[-1] = '------------';
 
     $query = '
@@ -671,5 +760,5 @@
       ;';
 
-	$result = pwg_query($query);
+		$result = pwg_query($query);
           
     while ($row = mysql_fetch_array($result))
@@ -681,5 +770,5 @@
 // |                           Template Init                               |
 // +-----------------------------------------------------------------------+
-	$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
+		$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
 
     if (isset($_GET['start']) and is_numeric($_GET['start']))
@@ -701,8 +790,8 @@
 
 /* Hide radio-button if not allow to assign adviser */
-	if ($conf['allow_adviser'])
-    {
-      $template->assign('adviser', true);
-    }
+		if ($conf['allow_adviser'])
+    	{
+      	$template->assign('adviser', true);
+    	}
 	
 // +-----------------------------------------------------------------------+
@@ -710,6 +799,6 @@
 // +-----------------------------------------------------------------------+
 
-	$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=';
+		$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();
@@ -717,5 +806,5 @@
     {
 /* simulate LIMIT $start, $conf['users_page'] */
-      if ($num < $start)
+			if ($num < $start)
       {
         continue;
@@ -727,7 +816,7 @@
 
       $visible_user_list[] = $local_user;
-	}
-
-	foreach ($visible_user_list as $local_user)
+		}
+
+		foreach ($visible_user_list as $local_user)
     {
       $groups_string = preg_replace(
@@ -738,79 +827,74 @@
             $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($_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'],
-                )
-              );
-        }
-	  }
-
-
-
-
+			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);
-	  }
- 	}  
+		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->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'));
+		array_push($page['infos'], l10n('Err_UserManager_Settings'));
   }
   break; 
- 
 }
 ?>
Index: extensions/NBC_UserAdvManager/trunk/admin/confirmmail.tpl
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/confirmmail.tpl	(revision 3846)
+++ extensions/NBC_UserAdvManager/trunk/admin/confirmmail.tpl	(revision 3858)
@@ -15,10 +15,4 @@
       <br>
 		</li>
-		<!-- This function can't be set due to no access to server's cron functionnalities -->
-		<!-- <li><label>{'UserAdvManager_ConfirmMail_AutoDel'|@translate}</label><br>
-        <input type="radio" value="true" {$UserAdvManager_CONFIRMMAIL_AUTODEL_TRUE} name="UserAdvManager_ConfirmMail_AutoDel"/> {'UserAdvManager_ConfirmMail_AutoDel_true'|@translate}<br>
-        <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_AUTODEL_FALSE} name="UserAdvManager_ConfirmMail_AutoDel"/> {'UserAdvManager_ConfirmMail_AutoDel_false'|@translate}<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>
Index: extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl	(revision 3846)
+++ extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl	(revision 3858)
@@ -29,9 +29,8 @@
     			<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}
-    			<td style="text-align:center;">{$user.REGISTRATION}</td>
+    			{/foreach}    			
   			</tr>
   		{/foreach}
@@ -52,7 +51,4 @@
   <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" />
-  <!--
-<input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} />
--->
 </p>
   </fieldset>
