Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1491)
+++ branches/2.8.x/CHANGELOG	(revision 1492)
@@ -12,6 +12,11 @@
 
 =============================== FEATURES FREEZE ================================
 ----------------------------------- Fixes 2.8.2 --------------------------------
+11 Aug-2011 Build 1492 Dietmar Woellbrink (Luisehahne)
+# Ticket #1107 Deleting users not possible
+  Change handling, first user will be set to inactive
+  secound inactive user will be show in an extra dropdown
+  and can now deleted from user table or reactivated
 11 Aug-2011 Build 1491 Dietmar Woellbrink (Luisehahne)
 ! comment out $email_body .= "\n\nIP: ".$_SERVER['REMOTE_ADDR'];
 11 Aug-2011 Build 1490 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1491)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1492)
@@ -52,4 +52,4 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.2');
-if(!defined('REVISION')) define('REVISION', '1491');
+if(!defined('REVISION')) define('REVISION', '1492');
Index: branches/2.8.x/wb/admin/users/users.php
===================================================================
--- branches/2.8.x/wb/admin/users/users.php	(revision 1491)
+++ branches/2.8.x/wb/admin/users/users.php	(revision 1492)
@@ -31,6 +31,9 @@
 			$admin = new admin('Access', 'users_modify');
 			$user_id = intval($admin->checkIDKEY('user_id', 0, $_SERVER['REQUEST_METHOD']));
 			// Check if user id is a valid number and doesnt equal 1
+			if($user_id == 0){
+			$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS'] );
+            }
 			if( ($user_id < 2 ) )
 			{
 				// if($admin_header) { $admin->print_header(); }
@@ -37,7 +40,7 @@
 				$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'] );
 			}
 			// Get existing values
-			$results = $database->query("SELECT * FROM ".TABLE_PREFIX."users WHERE user_id = '".$user_id."'");
+			$results = $database->query("SELECT * FROM `".TABLE_PREFIX."users` WHERE `user_id` = '".$user_id."'");
 			$user = $results->fetchRow();
 
 			// Setup template object
@@ -149,6 +152,7 @@
 			// Insert language text and messages
 			$template->set_var(array(
 								'TEXT_RESET' => $TEXT['RESET'],
+								'TEXT_CANCEL' => $TEXT['CANCEL'],
 								'TEXT_ACTIVE' => $TEXT['ACTIVE'],
 								'TEXT_DISABLED' => $TEXT['DISABLED'],
 								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
@@ -169,6 +173,8 @@
 			// Parse template object
 			$template->parse('main', 'main_block', false);
 			$template->pparse('output', 'page');
+			// Print admin footer
+			$admin->print_footer();
 			break;
 		case 'delete' :
 			// Print header
@@ -175,22 +181,31 @@
 			$admin = new admin('Access', 'users_delete');
 			$user_id = intval($admin->checkIDKEY('user_id', 0, $_SERVER['REQUEST_METHOD']));
 			// Check if user id is a valid number and doesnt equal 1
+			if($user_id == 0){
+			$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS'] );
+            }
 			if( ($user_id < 2 ) )
 			{
 				// if($admin_header) { $admin->print_header(); }
 				$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'] );
 			}
-			// Delete the user
-			$database->query("UPDATE `".TABLE_PREFIX."users` SET `active` = 0 WHERE `user_id` = '".$user_id."' ");
+			$sql  = 'SELECT `active` FROM `'.TABLE_PREFIX.'users` ';
+            $sql .= 'WHERE `user_id` = '.$user_id.'';
+            if( ($iDeleteUser = $database->get_one($sql)) == 1 ) {
+				// Delete the user
+				$database->query("UPDATE `".TABLE_PREFIX."users` SET `active` = 0 WHERE `user_id` = '".$user_id."' ");
+            } else {
+				$database->query("DELETE FROM `".TABLE_PREFIX."users` WHERE `user_id` = ".$user_id);
+            }
+
 			if($database->is_error()) {
 				$admin->print_error($database->get_error());
 			} else {
-				$admin->print_success($MESSAGE['USERS']['DELETED']);
+				$admin->print_success($MESSAGE['USERS_DELETED']);
 			}
+			// Print admin footer
+			$admin->print_footer();
 			break;
 	default:
 			break;
 endswitch;
-
-// Print admin footer
-$admin->print_footer();
Index: branches/2.8.x/wb/admin/users/index.php
===================================================================
--- branches/2.8.x/wb/admin/users/index.php	(revision 1491)
+++ branches/2.8.x/wb/admin/users/index.php	(revision 1492)
@@ -20,6 +20,10 @@
 require_once(WB_PATH.'/framework/class.admin.php');
 $admin = new admin('Access', 'users');
 
+$iUserStatus = 1;
+$iUserStatus = ( ( $admin->get_get('status')==1 ) ? 0 : $iUserStatus );
+unset($_GET);
+
 // Create new template object for the modify/remove menu
 $template = new Template(THEME_PATH.'/templates');
 $template->set_file('page', 'users.htt');
@@ -27,27 +31,42 @@
 $template->set_block("main_block", "manage_groups_block", "groups");
 $template->set_var('ADMIN_URL', ADMIN_URL);
 $template->set_var('FTAN', $admin->getFTAN());
+$template->set_var('USER_STATUS', $iUserStatus );
 
+$UserStatusActive = 'url('.THEME_URL.'/images/user.png)';
+$UserStatusInactive = 'url('.THEME_URL.'/images/user_red.png)';
+
+$sUserTitle = ($iUserStatus == 0) ? $MENU['USERS'].' '.strtolower($TEXT['ACTIVE']) : $MENU['USERS'].' '.strtolower($TEXT['DELETED']) ;
+
+$template->set_var('TEXT_USERS', $sUserTitle.' '.$TEXT['SHOW'] );
+$template->set_var('STATUS_ICON', ( ($iUserStatus==0) ? $UserStatusActive : $UserStatusInactive) );
+
 // Get existing value from database
-// $database = new database();
+$sql  = 'SELECT `user_id`, `username`, `display_name`, `active` FROM `'.TABLE_PREFIX.'users` ' ;
+$sql .= 'WHERE user_id != 1 ';
+$sql .=     'AND active = '.$iUserStatus.' ';
+$sql .= 'ORDER BY `display_name`,`username`';
+
 $query = "SELECT user_id, username, display_name, active FROM ".TABLE_PREFIX."users WHERE user_id != '1' ORDER BY display_name,username";
-$results = $database->query($query);
+$results = $database->query($sql);
 if($database->is_error()) {
 	$admin->print_error($database->get_error(), 'index.php');
 }
 
+$sUserList  = $TEXT['LIST_OPTIONS'].' ';
+$sUserList .= ($iUserStatus == 1) ? $MENU['USERS'].' '.strtolower($TEXT['ACTIVE']) : $MENU['USERS'].' '.strtolower($TEXT['DELETED']) ;
 // Insert values into the modify/remove menu
 $template->set_block('main_block', 'list_block', 'list');
 if($results->numRows() > 0) {
 	// Insert first value to say please select
 	$template->set_var('VALUE', '');
-	$template->set_var('NAME', $TEXT['PLEASE_SELECT'].'...');
-	$template->set_var('STATUS', 'text-decoration :none;' );
+	$template->set_var('NAME', $sUserList);
+	$template->set_var('STATUS', 'class="user-active"' );
 	$template->parse('list', 'list_block', true);
 	// Loop through users
 	while($user = $results->fetchRow()) {
 		$template->set_var('VALUE',$admin->getIDKEY($user['user_id']));
-		$template->set_var('STATUS', ($user['active']==false ? 'text-decoration:line-through' : 'text-decoration :none;') );
+		$template->set_var('STATUS', ($user['active']==false ? 'class="user-inactive"' : 'class="user-active"') );
 		$template->set_var('NAME', $user['display_name'].' ('.$user['username'].')');
 		$template->parse('list', 'list_block', true);
 	}
@@ -67,10 +86,11 @@
 if($admin->get_permission('users_delete') != true) {
 	$template->set_var('DISPLAY_DELETE', 'hide');
 }
-
+$HeaderTitle = $HEADING['MODIFY_DELETE_USER'].' ';
+$HeaderTitle .= (($iUserStatus == 1) ? strtolower($TEXT['ACTIVE']) : strtolower($TEXT['DELETED']));
 // Insert language headings
 $template->set_var(array(
-		'HEADING_MODIFY_DELETE_USER' => $HEADING['MODIFY_DELETE_USER'],
+		'HEADING_MODIFY_DELETE_USER' => $HeaderTitle,
 		'HEADING_ADD_USER' => $HEADING['ADD_USER']
 		)
 );
@@ -86,7 +106,7 @@
 		'TEXT_MODIFY' => $TEXT['MODIFY'],
 		'TEXT_DELETE' => $TEXT['DELETE'],
 		'TEXT_MANAGE_GROUPS' => ( $admin->get_permission('groups') == true ) ? $TEXT['MANAGE_GROUPS'] : "**",
-		'CONFIRM_DELETE' => $MESSAGE['USERS']['CONFIRM_DELETE']
+		'CONFIRM_DELETE' => (($iUserStatus == 1) ? $TEXT['ARE_YOU_SURE'] : $MESSAGE['USERS']['CONFIRM_DELETE'])
 		)
 );
 if ( $admin->get_permission('groups') == true ) $template->parse("groups", "manage_groups_block", true);
@@ -177,6 +197,7 @@
 
 // Insert language text and messages
 $template->set_var(array(
+			'TEXT_CANCEL' => $TEXT['CANCEL'],
 			'TEXT_RESET' => $TEXT['RESET'],
 			'TEXT_ACTIVE' => $TEXT['ACTIVE'],
 			'TEXT_DISABLED' => $TEXT['DISABLED'],
Index: branches/2.8.x/wb/templates/wb_theme/images/user_red.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png

Property changes on: branches/2.8.x/wb/templates/wb_theme/images/user_red.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: branches/2.8.x/wb/templates/wb_theme/images/user_delete.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png

Property changes on: branches/2.8.x/wb/templates/wb_theme/images/user_delete.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: branches/2.8.x/wb/templates/wb_theme/images/user.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png

Property changes on: branches/2.8.x/wb/templates/wb_theme/images/user.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: branches/2.8.x/wb/templates/wb_theme/theme.css
===================================================================
--- branches/2.8.x/wb/templates/wb_theme/theme.css	(revision 1491)
+++ branches/2.8.x/wb/templates/wb_theme/theme.css	(revision 1492)
@@ -169,4 +169,7 @@
 .msg-box { background : #e5ffe6; border :0.2em #009900 solid; color :#336600; margin-bottom :1em; padding :0.63em; text-align :center; }
 .error-box { background :#fee; border :0.2em #844 solid; color :#400; margin-bottom :1em; padding :0.63em; text-align :center; }
 .msg-box p,
-.error-box p { font-size :120%; }
\ No newline at end of file
+.error-box p { font-size :120%; }
+
+select > option.user-inactive { color :#990000; }
+button.status { cursor :pointer; border-radius :5px; -khtml-border-radius :5px; -webkit-border-radius :5px; -moz-border-radius :5px; }
\ No newline at end of file
Index: branches/2.8.x/wb/templates/wb_theme/templates/users_form.htt
===================================================================
--- branches/2.8.x/wb/templates/wb_theme/templates/users_form.htt	(revision 1491)
+++ branches/2.8.x/wb/templates/wb_theme/templates/users_form.htt	(revision 1492)
@@ -85,6 +85,7 @@
 	<td>
 		<input type="submit" name="submit" value="{SUBMIT_TITLE}" />
 		<input type="reset" name="reset" value="{TEXT_RESET}" />
+		<input type="button" style="width: 100px; margin-top: 5px;" onclick="javascript: window.location = 'index.php';" value="{TEXT_CANCEL}">
 	</td>
 </tr>
 </table>
Index: branches/2.8.x/wb/templates/wb_theme/templates/users.htt
===================================================================
--- branches/2.8.x/wb/templates/wb_theme/templates/users.htt	(revision 1491)
+++ branches/2.8.x/wb/templates/wb_theme/templates/users.htt	(revision 1492)
@@ -1,8 +1,8 @@
 <!-- BEGIN main_block -->
 
 <form name="users" action="users.php" method="post">
+<input type="hidden" name="status" value="{USER_STATUS}" />
 {FTAN}
-<input type="hidden" name="action" value="delete" />
 
 <table summary="" cellpadding="0" cellspacing="0" border="0" width="100%">
 <tr>
@@ -16,12 +16,10 @@
 	</td>
 </tr>
 </table>
-
-<br />
-
+<button type="button" name="status" title="{TEXT_USERS}" style="width: 40px; background: {STATUS_ICON} no-repeat center" value="{USER_STATUS}" onclick="javascript: window.location = 'index.php?status={USER_STATUS}';" class="status {DISPLAY_MODIFY}" >&nbsp;</button>
 <select name="user_id" style="width: 500px;">
 <!-- BEGIN list_block -->
-	<option value="{VALUE}" style="{STATUS}">{NAME}</option>
+	<option value="{VALUE}" {STATUS}>{NAME}</option>
 <!-- END list_block -->
 </select>
 
@@ -31,7 +29,6 @@
 </form>
 
 <br />
-
 <h2 style="margin-top: 20px;" class="{DISPLAY_ADD}">{HEADING_ADD_USER}</h2>
 
 <!-- END main_block -->
\ No newline at end of file
Index: branches/2.8.x/wb/templates/argos_theme/images/user_red.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png

Property changes on: branches/2.8.x/wb/templates/argos_theme/images/user_red.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: branches/2.8.x/wb/templates/argos_theme/images/user_delete.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png

Property changes on: branches/2.8.x/wb/templates/argos_theme/images/user_delete.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: branches/2.8.x/wb/templates/argos_theme/images/user.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png

Property changes on: branches/2.8.x/wb/templates/argos_theme/images/user.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: branches/2.8.x/wb/templates/argos_theme/theme.css
===================================================================
--- branches/2.8.x/wb/templates/argos_theme/theme.css	(revision 1491)
+++ branches/2.8.x/wb/templates/argos_theme/theme.css	(revision 1492)
@@ -190,4 +190,6 @@
 .msg-box { background : #e5ffe6; border :0.2em #009900 solid; color :#336600; margin-bottom :1em; padding :0.63em; text-align :center; }
 .error-box { background :#fee; border :0.2em #844 solid; color :#400; margin-bottom :1em; padding :0.63em; text-align :center; }
 .msg-box p,
-.error-box p { font-size :120%; }
\ No newline at end of file
+.error-box p { font-size :120%; }
+select > option.user-inactive { color :#990000; }
+button.status { cursor :pointer; border-radius :5px; -khtml-border-radius :5px; -webkit-border-radius :5px; -moz-border-radius :5px; }
\ No newline at end of file
Index: branches/2.8.x/wb/templates/argos_theme/templates/users.htt
===================================================================
--- branches/2.8.x/wb/templates/argos_theme/templates/users.htt	(revision 1491)
+++ branches/2.8.x/wb/templates/argos_theme/templates/users.htt	(revision 1492)
@@ -1,7 +1,7 @@
 <!-- BEGIN main_block -->
 
 <form name="users" action="users.php" method="post">
-<input type="hidden" name="action" value="delete" />
+<input type="hidden" name="userstatus" value="{USER_STATUS}" />
 {FTAN}
 
 <table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="100%" style="margin-bottom:10px;">
@@ -14,10 +14,10 @@
 		</td>
      </tr>
 </table>
-
+<button type="button" name="status" title="{TEXT_USERS}" style="width: 30px; background: {STATUS_ICON} no-repeat center" value="{USER_STATUS}" onclick="javascript: window.location = 'index.php?status={USER_STATUS}';" class="status {DISPLAY_MODIFY}" >&nbsp;</button>
 <select name="user_id" style="width: 500px;">
 <!-- BEGIN list_block -->
-	<option value="{VALUE}" style="{STATUS}">{NAME}</option>
+	<option value="{VALUE}" {STATUS}>{NAME}</option>
 <!-- END list_block -->
 </select>
 
@@ -27,7 +27,6 @@
 </form>
 
 <br />
-
 <h2 style="margin-top: 20px;" class="{DISPLAY_ADD}">{HEADING_ADD_USER}</h2>
 
 <!-- END main_block -->
\ No newline at end of file
Index: branches/2.8.x/wb/templates/argos_theme/templates/users_form.htt
===================================================================
--- branches/2.8.x/wb/templates/argos_theme/templates/users_form.htt	(revision 1491)
+++ branches/2.8.x/wb/templates/argos_theme/templates/users_form.htt	(revision 1492)
@@ -85,6 +85,7 @@
 	<td>
 		<input type="submit" name="submit" value="{SUBMIT_TITLE}" />
 		<input type="reset" name="reset" value="{TEXT_RESET}" />
+		<input type="button" style="width: 100px; margin-top: 5px;" onclick="javascript: window.location = 'index.php';" value="{TEXT_CANCEL}">
 	</td>
 </tr>
 </table>
Index: branches/2.8.x/wb/languages/DE.php
===================================================================
--- branches/2.8.x/wb/languages/DE.php	(revision 1491)
+++ branches/2.8.x/wb/languages/DE.php	(revision 1492)
@@ -350,7 +350,7 @@
 $TEXT['UPGRADE'] = 'Aktualisieren';
 $TEXT['UPLOAD_FILES'] = 'Datei(en) &uuml;bertragen';
 $TEXT['URL'] = 'URL';
-$TEXT['USER'] = 'Besitzer';
+$TEXT['USER'] = 'Benutzer';
 $TEXT['USERNAME'] = 'Benutzername';
 $TEXT['USERS_ACTIVE'] = 'Benutzer ist aktiv';
 $TEXT['USERS_CAN_SELFDELETE'] = 'Selbstl&ouml;schung m&ouml;glich';
