Skip to content
This repository was archived by the owner on May 4, 2025. It is now read-only.

Commit f01f18c

Browse files
committed
Merge branch 'main' of https://github.com/anditv21/panel
2 parents 2582350 + 62aecbc commit f01f18c

File tree

2 files changed

+84
-58
lines changed

2 files changed

+84
-58
lines changed

src/admin/bans.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@
102102
<tbody>
103103
<?php
104104
$min = isset($_GET["min"]) ? Util::securevar($_GET["min"]) : 1;
105-
$max = isset($_GET["max"]) ? Util::securevar($_GET["max"]) : 10;
105+
$max = isset($_GET["max"]) ? Util::securevar($_GET["max"]) : 10;
106106

107-
foreach ($bannedUserList as $user) :
108-
if ($user->uid >= $min && $user->uid <= $max) :
109-
?>
107+
foreach ($bannedUserList as $user) :
108+
if ($user->uid >= $min && $user->uid <= $max) :
109+
?>
110110
<tr>
111111
<td>
112112
<?php
@@ -115,9 +115,9 @@
115115
?>
116116
<img title="Click to download" data-toggle="tooltip" data-placement="top" class="border rounded-circle img-profile" src="../assets/images/avatars/Portrait_Placeholder.png" width="45" height="45">
117117
<?php else :
118-
$ext = pathinfo($avatarUrl, PATHINFO_EXTENSION);
119-
$filename = "{$user->uid}.{$ext}";
120-
?>
118+
$ext = pathinfo($avatarUrl, PATHINFO_EXTENSION);
119+
$filename = "{$user->uid}.{$ext}";
120+
?>
121121
<a href="<?= $avatarUrl; ?>" download="<?= $filename; ?>">
122122
<img title="Click to download" data-toggle="tooltip" data-placement="top" class="rounded-circle img-profile" width="45" height="45" src="<?= $avatarUrl; ?>"></a>
123123
<?php endif; ?>
@@ -141,8 +141,8 @@
141141
</tr>
142142
<?php
143143
endif;
144-
endforeach;
145-
?>
144+
endforeach;
145+
?>
146146
</tbody>
147147
</table>
148148
</div>

src/admin/index.php

Lines changed: 75 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -23,55 +23,81 @@
2323
// Handle POST request
2424
if ($_SERVER["REQUEST_METHOD"] === "POST") {
2525

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;
75101
}
76102
?>
77103

0 commit comments

Comments
 (0)