|
23 | 23 | // Handle POST request |
24 | 24 | if ($_SERVER["REQUEST_METHOD"] === "POST") { |
25 | 25 |
|
26 | | - // Check the request method again for added security |
27 | | - if (Util::securevar($_SERVER["REQUEST_METHOD"]) === "POST") { |
28 | | - |
29 | | - // Sanitize and assign POST variables |
30 | | - $params = [ |
31 | | - 'SystemStatus', 'SystemMaint', 'SystemVersion', 'invite', 'Systemfreeze', |
32 | | - 'flushchat', 'setnews', 'invwave', 'discordlinking', 'discordrelinking', |
33 | | - 'discordlogging', 'service', 'setkey', 'setsecret', 'setcolor', 'captcha_option' |
34 | | - ]; |
35 | | - |
36 | | - foreach ($params as $param) { |
37 | | - if (isset($_POST[$param])) { |
38 | | - ${$param} = Util::securevar($_POST[$param]); |
39 | | - } |
40 | | - } |
41 | | - |
42 | | - // Perform admin check |
43 | | - Util::adminCheck(); |
44 | | - |
45 | | - // Execute admin functions based on the sanitized POST variables |
46 | | - if (isset($SystemStatus)) $admin->setSystemStatus(); |
47 | | - if (isset($SystemMaint)) $admin->setSystemMaint(); |
48 | | - if (isset($SystemVersion)) { |
49 | | - $ver = floatval(Util::securevar($_POST["version"])); |
50 | | - $admin->setSystemVersion($ver); |
51 | | - } |
52 | | - if (isset($invite)) $admin->setinvite(); |
53 | | - if (isset($Systemfreeze)) $admin->setSystemfreeze(); |
54 | | - if (isset($flushchat)) $admin->flushchat(); |
55 | | - if (isset($setnews)) { |
56 | | - $news = Util::securevar($_POST["msg"]); |
57 | | - $admin->setnews($news); |
58 | | - } |
59 | | - if (isset($invwave)) $admin->invwave(); |
60 | | - if (isset($discordlinking)) $admin->setDiscordLink(); |
61 | | - if (isset($discordrelinking)) $admin->setDiscordReLink(); |
62 | | - if (isset($discordlogging)) $admin->setDiscordLogging(); |
63 | | - if (isset($captcha_option)) $admin->setCaptchaSystem($captcha_option); |
64 | | - if (isset($setkey)) $admin->setCaptchaKey($setkey); |
65 | | - if (isset($setsecret)) $admin->setCaptchaSecret($setsecret); |
66 | | - if (isset($setcolor)) $admin->changeEmbedColor($setcolor); |
67 | | - |
68 | | - // Redirect to system page after processing |
69 | | - header("location: index.php"); |
70 | | - exit; |
71 | | - } |
72 | | - |
73 | | - header("location: index.php"); |
74 | | - exit; |
| 26 | + // Check the request method again for added security |
| 27 | + if (Util::securevar($_SERVER["REQUEST_METHOD"]) === "POST") { |
| 28 | + |
| 29 | + // Sanitize and assign POST variables |
| 30 | + $params = [ |
| 31 | + 'SystemStatus', 'SystemMaint', 'SystemVersion', 'invite', 'Systemfreeze', |
| 32 | + 'flushchat', 'setnews', 'invwave', 'discordlinking', 'discordrelinking', |
| 33 | + 'discordlogging', 'service', 'setkey', 'setsecret', 'setcolor', 'captcha_option' |
| 34 | + ]; |
| 35 | + |
| 36 | + foreach ($params as $param) { |
| 37 | + if (isset($_POST[$param])) { |
| 38 | + ${$param} = Util::securevar($_POST[$param]); |
| 39 | + } |
| 40 | + } |
| 41 | + |
| 42 | + // Perform admin check |
| 43 | + Util::adminCheck(); |
| 44 | + |
| 45 | + // Execute admin functions based on the sanitized POST variables |
| 46 | + if (isset($SystemStatus)) { |
| 47 | + $admin->setSystemStatus(); |
| 48 | + } |
| 49 | + if (isset($SystemMaint)) { |
| 50 | + $admin->setSystemMaint(); |
| 51 | + } |
| 52 | + if (isset($SystemVersion)) { |
| 53 | + $ver = floatval(Util::securevar($_POST["version"])); |
| 54 | + $admin->setSystemVersion($ver); |
| 55 | + } |
| 56 | + if (isset($invite)) { |
| 57 | + $admin->setinvite(); |
| 58 | + } |
| 59 | + if (isset($Systemfreeze)) { |
| 60 | + $admin->setSystemfreeze(); |
| 61 | + } |
| 62 | + if (isset($flushchat)) { |
| 63 | + $admin->flushchat(); |
| 64 | + } |
| 65 | + if (isset($setnews)) { |
| 66 | + $news = Util::securevar($_POST["msg"]); |
| 67 | + $admin->setnews($news); |
| 68 | + } |
| 69 | + if (isset($invwave)) { |
| 70 | + $admin->invwave(); |
| 71 | + } |
| 72 | + if (isset($discordlinking)) { |
| 73 | + $admin->setDiscordLink(); |
| 74 | + } |
| 75 | + if (isset($discordrelinking)) { |
| 76 | + $admin->setDiscordReLink(); |
| 77 | + } |
| 78 | + if (isset($discordlogging)) { |
| 79 | + $admin->setDiscordLogging(); |
| 80 | + } |
| 81 | + if (isset($captcha_option)) { |
| 82 | + $admin->setCaptchaSystem($captcha_option); |
| 83 | + } |
| 84 | + if (isset($setkey)) { |
| 85 | + $admin->setCaptchaKey($setkey); |
| 86 | + } |
| 87 | + if (isset($setsecret)) { |
| 88 | + $admin->setCaptchaSecret($setsecret); |
| 89 | + } |
| 90 | + if (isset($setcolor)) { |
| 91 | + $admin->changeEmbedColor($setcolor); |
| 92 | + } |
| 93 | + |
| 94 | + // Redirect to system page after processing |
| 95 | + header("location: index.php"); |
| 96 | + exit; |
| 97 | + } |
| 98 | + |
| 99 | + header("location: index.php"); |
| 100 | + exit; |
75 | 101 | } |
76 | 102 | ?> |
77 | 103 |
|
|
0 commit comments