diff options
author | Jan-Philipp Litza <janphilipp@litza.de> | 2012-12-27 02:54:57 +0100 |
---|---|---|
committer | Jan-Philipp Litza <janphilipp@litza.de> | 2012-12-27 02:54:57 +0100 |
commit | 0f0f847af4c9ffe8138c802086bda7eb15f9baef (patch) | |
tree | e0606c6eb37707b372e65cf1c5f6243254eb94fe /includes | |
parent | 670cd715c559c521fe8f315fa34c00ac4f5defcb (diff) |
minor fixes for logging and user editing and searching
Diffstat (limited to 'includes')
-rw-r--r-- | includes/pages/admin_free.php | 1 | ||||
-rw-r--r-- | includes/pages/admin_user.php | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php index d6f4b7a0..88a96965 100644 --- a/includes/pages/admin_free.php +++ b/includes/pages/admin_free.php @@ -57,6 +57,7 @@ function admin_free() { return template_render('../templates/admin_free.html', array ( 'search' => $search, 'angeltypes' => html_select_key('angeltype', 'angeltype', $angel_types, $_REQUEST['angeltype']), + 'confirmed_only' => isset($_REQUEST['confirmed_only'])? 'checked' : '', 'table' => $table, 'link' => page_link_to('admin_free') )); diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 8d900c1b..f4902e1c 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -103,9 +103,10 @@ function admin_user() { if (isset ($_REQUEST['submit_user_angeltypes'])) { $selected_angel_types = array_intersect($_REQUEST['selected_angel_types'], array_keys($angel_types)); - $accepted_angel_types = array_diff(array_intersect($_REQUEST['accepted_angel_types'], array_keys($angel_types)), $nonrestricted_angel_types); + $accepted_angel_types = array_unique(array_diff(array_intersect($_REQUEST['accepted_angel_types'], array_keys($angel_types)), $nonrestricted_angel_types)); if (in_array("admin_user_angeltypes", $privileges)) - $selected_angel_types = array_merge($selected_angel_types, $accepted_angel_types); + $selected_angel_types = array_merge((array) $selected_angel_types, $accepted_angel_types); + $selected_angel_types = array_unique($selected_angel_types); // Assign angel-types sql_start_transaction(); @@ -227,10 +228,11 @@ function admin_user() { case 'delete' : if ($user['UID'] != $id) { + $nickname = sql_select("SELECT `Nick` FROM `User` WHERE `UID` = '" . sql_escape($id) . "' LIMIT 1"); sql_query("DELETE FROM `User` WHERE `UID`=" . sql_escape($id) . " LIMIT 1"); sql_query("DELETE FROM `UserGroups` WHERE `uid`=" . sql_escape($id)); sql_query("UPDATE `ShiftEntry` SET `UID`=0, `Comment`=NULL WHERE `UID`=" . sql_escape($id)); - engelsystem_log("Deleted user " . $user_source['Nick']); + engelsystem_log("Deleted user " . $nickname[0]['Nick']); $html .= success("Benutzer gelöscht!", true); } else { $html .= error("Du kannst Dich nicht selber löschen!", true); |