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_REGISTER_DECLINED_BODY"] . "
"); } else { - print("