Index: /extensions/NBC_UserAdvManager-Trunk/admin/UserAdvManager_admin.php
===================================================================
--- /extensions/NBC_UserAdvManager-Trunk/admin/UserAdvManager_admin.php	(revision 3459)
+++ /extensions/NBC_UserAdvManager-Trunk/admin/UserAdvManager_admin.php	(revision 3460)
@@ -301,5 +301,5 @@
 
 // +-----------------------------------------------------------------------+
-// |                           ConfirMail Config                           |
+// |                           ConfirmMail Config                          |
 // +-----------------------------------------------------------------------+
 	case 'confirmmail':
@@ -329,16 +329,15 @@
 		$conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
 
-	/* List timed out users */		
-	/* Get registration date  */
-	/* Under construction ;-) */
 function get_unvalid_user_list()
 {
-/*  global $conf, $page;
-
+  global $conf, $page;
+  
+  $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();  
+  
   $users = array();
-  $order_by = 'id';
-  $direction = 'ASC';
+
+  // search users depending on filters and order
   $query = '
-			SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
+SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
                 u.'.$conf['user_fields']['username'].' AS username,
                 u.'.$conf['user_fields']['email'].' AS email,
@@ -346,21 +345,25 @@
                 ui.adviser,
                 ui.enabled_high,
-                ui.level
-			FROM '.USERS_TABLE.' AS u
-			INNER JOIN '.USER_INFOS_TABLE.' AS ui
-      		ON u.'.$conf['user_fields']['id'].' = ui.user_id
-    		LEFT JOIN '.USER_GROUP_TABLE.' AS ug
-      		ON u.'.$conf['user_fields']['id'].' = ug.user_id
-  			WHERE u.'.$conf['user_fields']['id'].' > 0';
-  $query.= '
-  			ORDER BY '.$order_by.' '.$direction.'
-			;';
+                ui.level,
+                ui.registration_date
+  FROM '.USERS_TABLE.' AS u
+    INNER JOIN '.USER_INFOS_TABLE.' AS ui
+      ON u.'.$conf['user_fields']['id'].' = ui.user_id
+    LEFT JOIN '.USER_GROUP_TABLE.' AS ug
+      ON u.'.$conf['user_fields']['id'].' = ug.user_id
+  WHERE u.'.$conf['user_fields']['id'].' > 0
+  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();
+    $user = $row;
+    $user['groups'] = array();
+
     array_push($users, $user);
   }
+
   // add group lists
   $user_ids = array();
@@ -374,11 +377,9 @@
   {
     $query = '
-			SELECT user_id, group_id
-  			FROM '.USER_GROUP_TABLE.'
-  			WHERE user_id IN ('.implode(',', $user_ids).')
-			;';
-    
-	$result = pwg_query($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))
     {
@@ -390,19 +391,6 @@
   }
 
-  return $users;*/
-}
-  
-/*		$query = "
-		  SELECT user.username, user.mail_address, info.registration_date
-		  FROM ".USERS_TABLE." as user, ".USER_INFOS_TABLE." as info
-		  WHERE user.id = info.user_id
-		  ;";
-		  
-		$result = pwg_query($query);
-		  
-		while ($row = mysql_fetch_array($result))
-		{
-
-		}*/
+  return $users;
+}
 
 // +-----------------------------------------------------------------------+
@@ -414,12 +402,234 @@
   die('Hacking attempt!');
 }
+
 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
 
-$page['filtered_users'] = get_unvalid_user_list();	
-
+// +-----------------------------------------------------------------------+
+// | 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['delete']))
+{
+  $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['delete']) 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)
+  {
+    if (isset($_POST['confirm_deletion']) and 1 == $_POST['confirm_deletion'])
+    {
+      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]);
+        }
+      }
+    }
+    else
+    {
+      array_push($page['errors'], l10n('You need to confirm deletion'));
+    }
+  }
+}
+
+// +-----------------------------------------------------------------------+
+// |                              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');
+
+  $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,
+      'ACTION' => implode( ', ', $properties),
+      )
+    );
+}		
+
 	$template->assign(
 	array(
@@ -428,7 +638,5 @@
 		'UserAdvManager_CONFIRMMAIL_DELAY'   		    => $conf_nbc_UserAdvManager_ConfirmMail[1],
 		)
-	);
-		
-		
+	);		
 
 // +-----------------------------------------------------------------------+
Index: tensions/NBC_UserAdvManager-Trunk/admin/UserAdvManager_admin.tpl
===================================================================
--- /extensions/NBC_UserAdvManager-Trunk/admin/UserAdvManager_admin.tpl	(revision 3459)
+++ 	(revision )
@@ -1,70 +1,0 @@
-<div class="titrePage">
-  <h2>{'Title'|@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/>
-    	</li>
-    	<br/>
-    	<li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br/>
-        <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea>
-    	</li>
-    	<br/>
-    	<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/>
-    	</li>
-    	<br/>
-    	<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/>
-    	</li>
-    	<br/>
-    	<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/>
-    	</li>
-    	<br/>
-    	<li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br/>
-        <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea>
-    	</li>
-      <br/>
-    	<li><label>{'UserAdvManager_No_Confirm_Group'|@translate}</label><br/>
-		{html_options name="UserAdvManager_No_Confirm_Group" options=$No_Confirm_Group.group_options selected=$No_Confirm_Group.group_selected}
-    	</li>
-      <br/>
-    	<li><label>{'UserAdvManager_Validated_Group'|@translate}</label><br/>
-		{html_options name="UserAdvManager_Validated_Group" options=$Validated_Group.group_options selected=$Validated_Group.group_selected}
-    	</li>
-      <br/>
-    	<li><label>{'UserAdvManager_No_Confirm_Status'|@translate}</label><br/>
-		{html_options name="UserAdvManager_No_Confirm_Status" options=$No_Confirm_Status.Status_options selected=$No_Confirm_Status.Status_selected}
-    	</li>
-      <br/>
-    	<li><label>{'UserAdvManager_Validated_Status'|@translate}</label><br/>
-		{html_options name="UserAdvManager_Validated_Status" options=$Confirm_Status.Status_options selected=$Confirm_Status.Status_selected}
-    	</li>
-    	<br/>
-    	<li><label>{'UserAdvManager_No_Comment_Anonymous'|@translate}</label><br/>
-        <input type="radio" value="true" {$UserAdvManager_NO_COMMENT_ANO_TRUE} name="UserAdvManager_No_Comment_Anonymous"/>{'UserAdvManager_No_Comment_Anonymous_true'|@translate}<br/>
-        <input type="radio" value="false" {$UserAdvManager_NO_COMMENT_ANO_FALSE} name="UserAdvManager_No_Comment_Anonymous"/>{'UserAdvManager_No_Comment_Anonymous_false'|@translate}<br/>
-    	</li>
-    	<br/>
-    	<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><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br/>
-        <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea>
-    	</li>
-    	</li>
-    </ul>
-  	<div align="center"><input class="submit" type="submit" value="{'audit'|@translate}" name="audit" /> <input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} /></div>
-  </fieldset>
-</form>
Index: /extensions/NBC_UserAdvManager-Trunk/admin/confirmmail.tpl
===================================================================
--- /extensions/NBC_UserAdvManager-Trunk/admin/confirmmail.tpl	(revision 3459)
+++ /extensions/NBC_UserAdvManager-Trunk/admin/confirmmail.tpl	(revision 3460)
@@ -11,6 +11,6 @@
     <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/>
+        <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/>
     	</li>
       <br/>
@@ -25,5 +25,5 @@
       			<td>{'Email address'|@translate}</td>
       			<td>{'Groups'|@translate}</td>
-      			<td>{'Actions'|@translate}</td>
+      			<td>{'UserAdvManager_Indiv_Suppr'|@translate}</td>
     			</tr>
   			</thead>
@@ -41,8 +41,5 @@
     		{/foreach}
     			<td style="text-align:center;">
-      			<a href="{$user.U_PROFILE}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" class="button" style="border:none" alt="{'Profile'|@translate}" title="{'Profile'|@translate}" /></a>
-      		{foreach from=$user.plugin_actions item=data}
-	      		{$data}
-      		{/foreach}
+      			<a href="{$user.U_ACTION}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" class="button" style="border:none" alt="{'Profile'|@translate}" title="{'Profile'|@translate}" /></a>
       			</td>
   			</tr>
