From 316c18f9129451bd30484293cadc5e9e8c62f604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Sun, 5 Jan 2014 19:31:17 +0100 Subject: [PATCH] removed old user angeltypes --- includes/pages/admin_user_angeltypes.php | 100 ----------------------- includes/sys_menu.php | 1 - public/index.php | 4 - 3 files changed, 105 deletions(-) delete mode 100644 includes/pages/admin_user_angeltypes.php diff --git a/includes/pages/admin_user_angeltypes.php b/includes/pages/admin_user_angeltypes.php deleted file mode 100644 index 2b623d72..00000000 --- a/includes/pages/admin_user_angeltypes.php +++ /dev/null @@ -1,100 +0,0 @@ - 0) { - $angel_type_source = sql_select("SELECT `AngelTypes`.* FROM `AngelTypes` WHERE `AngelTypes`.`id`=" . sql_escape($_REQUEST['confirm_all']) . " LIMIT 1"); - if(count($angel_type_source) > 0) { - if(!isset($_REQUEST['confirmed'])) { - return page(array( - info("Möchtest Du wirklich alle Engel vom Typ " . $angel_type_source[0]['name'] . " freischalten?", true), - buttons(array( - button(page_link_to('admin_user_angeltypes'), "Abbrechen", 'cancel'), - button(page_link_to('admin_user_angeltypes') . '&confirm_all=' . $_REQUEST['confirm_all'] . '&confirmed', "Ok", 'ok') - )) - )); - } - sql_query("UPDATE `UserAngelTypes` SET `confirm_user_id`=" . sql_escape($_SESSION['uid']) . " WHERE `angeltype_id`=" . sql_escape($_REQUEST['confirm_all']) . " LIMIT 1"); - engelsystem_log("Confirmed all " . $angel_type_source[0]['name']); - success(_("Confirmed all.")); - } - else error(_("Entry not found.")); - redirect(page_link_to('admin_user_angeltypes')); - } - - if (isset ($_REQUEST['deny_all']) && test_request_int('deny_all') && sql_num_query("SELECT * FROM `UserAngelTypes` WHERE `angeltype_id`=" . sql_escape($_REQUEST['deny_all']) . " AND `confirm_user_id` IS NULL") > 0) { - $angel_type_source = sql_select("SELECT `AngelTypes`.* FROM `AngelTypes` WHERE `AngelTypes`.`id`=" . sql_escape($_REQUEST['deny_all'])); - if(count($angel_type_source) > 0) { - if(!isset($_REQUEST['confirmed'])) { - return page(array( - info("Möchtest Du wirklich alle Engel vom Typ " . $angel_type_source[0]['name'] . " ablehnen?", true), - buttons(array( - button(page_link_to('admin_user_angeltypes'), "Abbrechen", 'cancel'), - button(page_link_to('admin_user_angeltypes') . '&deny_all=' . $_REQUEST['deny_all'] . '&confirmed', "Ok", 'ok') - )) - )); - } - sql_query("DELETE FROM `UserAngelTypes` WHERE `confirm_user_id` IS NULL AND `angeltype_id`=" . sql_escape($_REQUEST['deny_all'])); - engelsystem_log("Denied all " . $angel_type_source[0]['name']); - success("Denied all."); - } - else error("Entry not found."); - redirect(page_link_to('admin_user_angeltypes')); - } - - if (isset ($_REQUEST['confirm']) && test_request_int('confirm') && sql_num_query("SELECT * FROM `UserAngelTypes` WHERE `id`=" . sql_escape($_REQUEST['confirm']) . " AND `confirm_user_id` IS NULL") > 0) { - $user_angel_type_source = sql_select("SELECT `UserAngelTypes`.*, `User`.`Nick`, `User`.`UID`, `AngelTypes`.`name` FROM `UserAngelTypes` JOIN `User` ON `User`.`UID`=`UserAngelTypes`.`user_id` JOIN `AngelTypes` ON `AngelTypes`.`id`=`UserAngelTypes`.`angeltype_id` WHERE `UserAngelTypes`.`id`=" . sql_escape($_REQUEST['confirm']) . " LIMIT 1"); - if(count($user_angel_type_source) > 0) { - sql_query("UPDATE `UserAngelTypes` SET `confirm_user_id`=" . sql_escape($_SESSION['uid']) . " WHERE `id`=" . sql_escape($_REQUEST['confirm']) . " LIMIT 1"); - engelsystem_log("Confirmed " . User_Nick_render($user_angel_type_source[0]) . " as " . $user_angel_type_source[0]['name']); - success("Confirmed."); - } - else error("Entry not found."); - redirect(page_link_to('admin_user_angeltypes')); - } - - if (isset ($_REQUEST['deny']) && test_request_int('deny') && sql_num_query("SELECT * FROM `UserAngelTypes` WHERE `id`=" . sql_escape($_REQUEST['deny']) . " AND `confirm_user_id` IS NULL") > 0) { - $user_angel_type_source = sql_select("SELECT `UserAngelTypes`.*, `User`.`Nick`, `User`.`UID`, `AngelTypes`.`name` FROM `UserAngelTypes` JOIN `User` ON `User`.`UID`=`UserAngelTypes`.`user_id` JOIN `AngelTypes` ON `AngelTypes`.`id`=`UserAngelTypes`.`angeltype_id` WHERE `UserAngelTypes`.`id`=" . sql_escape($_REQUEST['deny']) . " LIMIT 1"); - if(count($user_angel_type_source) > 0) { - sql_query("DELETE FROM `UserAngelTypes` WHERE `id`=" . sql_escape($_REQUEST['deny']) . " LIMIT 1"); - engelsystem_log("Denied " . User_Nick_render($user_angel_type_source[0]) . " as " . $user_angel_type_source[0]['name']); - success("Denied."); - } - else error("Entry not found."); - redirect(page_link_to('admin_user_angeltypes')); - } - - $angel_types_source = sql_select("SELECT * FROM `AngelTypes` WHERE `restricted`=1 ORDER BY `name`"); - $content = array(); - foreach($angel_types_source as $angel_type) { - $user_angel_types_source = sql_select("SELECT `UserAngelTypes`.`id`, `User`.`Nick`, `User`.`UID` FROM `UserAngelTypes` JOIN `User` ON `UserAngelTypes`.`user_id`=`User`.`UID` WHERE `UserAngelTypes`.`angeltype_id`=" . sql_escape($angel_type['id']) . " AND `UserAngelTypes`.`confirm_user_id` IS NULL ORDER BY `User`.`Nick`"); - if(count($user_angel_types_source)) { - $users = array (); - foreach ($user_angel_types_source as $user) { - $user['name'] = User_Nick_render($user); - $user['actions'] = img_button(page_link_to('admin_user_angeltypes') . '&confirm=' . $user['id'], 'tick', _("confirm")); - $user['actions'] .= '  '; - $user['actions'] .= img_button(page_link_to('admin_user_angeltypes') . '&deny=' . $user['id'], 'cross', _("deny")); - $users[] = $user; - } - $content[] = '

' . $angel_type['name'] . ' ' . img_button(page_link_to('admin_user_angeltypes') . '&confirm_all=' . $angel_type['id'], 'tick', '', _("confirm all")) . ' ' . img_button(page_link_to('admin_user_angeltypes') . '&deny_all=' . $angel_type['id'], 'cross', '', _("deny all")) . '

' . table(array ( - 'name' => "Nick", - 'actions' => "" - ), $users); - } - } - - return page(array ( - msg(), - join('', $content) - )); -} - -?> diff --git a/includes/sys_menu.php b/includes/sys_menu.php index ae39afeb..f7cefdfa 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -53,7 +53,6 @@ function make_navigation() { "admin_user" => admin_user_title(), "admin_free" => admin_free_title(), "admin_questions" => admin_questions_title(), - "admin_user_angeltypes" => admin_user_angeltypes_title(), "admin_shifts" => admin_shifts_title(), "admin_rooms" => admin_rooms_title(), "admin_groups" => admin_groups_title(), diff --git a/public/index.php b/public/index.php index 9cd01e40..ff8d2e43 100644 --- a/public/index.php +++ b/public/index.php @@ -49,7 +49,6 @@ require_once ('includes/pages/admin_questions.php'); require_once ('includes/pages/admin_rooms.php'); require_once ('includes/pages/admin_shifts.php'); require_once ('includes/pages/admin_user.php'); -require_once ('includes/pages/admin_user_angeltypes.php'); require_once ('includes/pages/guest_login.php'); require_once ('includes/pages/user_messages.php'); require_once ('includes/pages/user_myshifts.php'); @@ -159,9 +158,6 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i } elseif ($p == "admin_user") { $title = admin_user_title(); $content = admin_user(); - } elseif ($p == "admin_user_angeltypes") { - $title = admin_user_angeltypes_title(); - $content = admin_user_angeltypes(); } elseif ($p == "admin_arrive") { $title = admin_arrive_title(); $content = admin_arrive();