From d110322762dd0c5a49951087dbb1ed63ab2ca5f5 Mon Sep 17 00:00:00 2001 From: Krombel Date: Fri, 25 Jan 2019 02:50:38 +0100 Subject: [PATCH] change selection to radio buttons --- public/verify_admin.php | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/public/verify_admin.php b/public/verify_admin.php index 5daa013..f21b382 100644 --- a/public/verify_admin.php +++ b/public/verify_admin.php @@ -33,23 +33,19 @@ try { if ($_SERVER["REQUEST_METHOD"] != "GET") { throw new Exception("Method not allowed"); } - if (!isset($_GET["t"])) { + $token = filter_input(INPUT_GET, "t", FILTER_SANITIZE_STRING); + if (empty($token)) { throw new Exception("UNKNOWN_TOKEN"); } - $token = filter_var($_GET["t"], FILTER_SANITIZE_STRING); require_once(__DIR__ . "/../database.php"); - $action = NULL; - if (isset($_GET["allow"])) { + $param_action = filter_input(INPUT_GET, "d", FILTER_SANITIZE_STRING); + if ($param_action == "allow") { $action = RegisterState::RegistrationAccepted; - } - $decline_reason = NULL; - if (isset($_GET["deny"])) { + } elseif ($param_action == "deny") { $action = RegisterState::RegistrationDeclined; - if (isset($_GET["reason"])) { - $decline_reason = filter_var($_GET["reason"], FILTER_SANITIZE_STRING); - } + $decline_reason = filter_input(INPUT_GET, "reason", FILTER_SANITIZE_STRING); } $user = $mx_db->getUserForApproval($token); @@ -139,7 +135,6 @@ try { print("

" . $language["ADMIN_VERIFY_SITE_TITLE"] . "

"); print("

" . $language["ADMIN_REGISTER_DECLINED_BODY"] . "

"); } else { - print("" . $language["ADMIN_VERIFY_SITE_TITLE"] . ""); ?> @@ -196,9 +191,16 @@ try { +
+ "> +
- " class="btn btn-info btn-block"> - " class="btn btn-info btn-block"> +
+ + +
+ " class="btn btn-info btn-block"> @@ -206,7 +208,17 @@ try {