Skip to content
This repository was archived by the owner on May 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/admin/bans.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,22 @@
<tbody>
<?php
$min = isset($_GET["min"]) ? Util::securevar($_GET["min"]) : 1;
$max = isset($_GET["max"]) ? Util::securevar($_GET["max"]) : 10;
$max = isset($_GET["max"]) ? Util::securevar($_GET["max"]) : 10;

foreach ($bannedUserList as $user) :
if ($user->uid >= $min && $user->uid <= $max) :
?>
foreach ($bannedUserList as $user) :
if ($user->uid >= $min && $user->uid <= $max) :
?>
<tr>
<td>
<?php
$avatarUrl = Util::getavatar($user->uid);
if (!$avatarUrl) :
?>
$avatarUrl = Util::getavatar($user->uid);
if (!$avatarUrl) :
?>
<img title="Click to download" data-toggle="tooltip" data-placement="top" class="border rounded-circle img-profile" src="../assets/img/avatars/Portrait_Placeholder.png" width="45" height="45">
<?php else :
$ext = pathinfo($avatarUrl, PATHINFO_EXTENSION);
$filename = "{$user->uid}.{$ext}";
?>
$ext = pathinfo($avatarUrl, PATHINFO_EXTENSION);
$filename = "{$user->uid}.{$ext}";
?>
<a href="<?= $avatarUrl; ?>" download="<?= $filename; ?>">
<img title="Click to download" data-toggle="tooltip" data-placement="top" class="rounded-circle img-profile" width="45" height="45" src="<?= $avatarUrl; ?>"></a>
<?php endif; ?>
Expand All @@ -141,8 +141,8 @@
</tr>
<?php
endif;
endforeach;
?>
endforeach;
?>
</tbody>
</table>
</div>
Expand Down
124 changes: 75 additions & 49 deletions src/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,81 @@
// Handle POST request
if ($_SERVER["REQUEST_METHOD"] === "POST") {

// Check the request method again for added security
if (Util::securevar($_SERVER["REQUEST_METHOD"]) === "POST") {

// Sanitize and assign POST variables
$params = [
'SystemStatus', 'SystemMaint', 'SystemVersion', 'invite', 'Systemfreeze',
'flushchat', 'setnews', 'invwave', 'discordlinking', 'discordrelinking',
'discordlogging', 'service', 'setkey', 'setsecret', 'setcolor', 'captcha_option'
];

foreach ($params as $param) {
if (isset($_POST[$param])) {
${$param} = Util::securevar($_POST[$param]);
}
}

// Perform admin check
Util::adminCheck();

// Execute admin functions based on the sanitized POST variables
if (isset($SystemStatus)) $admin->setSystemStatus();
if (isset($SystemMaint)) $admin->setSystemMaint();
if (isset($SystemVersion)) {
$ver = floatval(Util::securevar($_POST["version"]));
$admin->setSystemVersion($ver);
}
if (isset($invite)) $admin->setinvite();
if (isset($Systemfreeze)) $admin->setSystemfreeze();
if (isset($flushchat)) $admin->flushchat();
if (isset($setnews)) {
$news = Util::securevar($_POST["msg"]);
$admin->setnews($news);
}
if (isset($invwave)) $admin->invwave();
if (isset($discordlinking)) $admin->setDiscordLink();
if (isset($discordrelinking)) $admin->setDiscordReLink();
if (isset($discordlogging)) $admin->setDiscordLogging();
if (isset($captcha_option)) $admin->setCaptchaSystem($captcha_option);
if (isset($setkey)) $admin->setCaptchaKey($setkey);
if (isset($setsecret)) $admin->setCaptchaSecret($setsecret);
if (isset($setcolor)) $admin->changeEmbedColor($setcolor);

// Redirect to system page after processing
header("location: index.php");
exit;
}

header("location: index.php");
exit;
// Check the request method again for added security
if (Util::securevar($_SERVER["REQUEST_METHOD"]) === "POST") {

// Sanitize and assign POST variables
$params = [
'SystemStatus', 'SystemMaint', 'SystemVersion', 'invite', 'Systemfreeze',
'flushchat', 'setnews', 'invwave', 'discordlinking', 'discordrelinking',
'discordlogging', 'service', 'setkey', 'setsecret', 'setcolor', 'captcha_option'
];

foreach ($params as $param) {
if (isset($_POST[$param])) {
${$param} = Util::securevar($_POST[$param]);
}
}

// Perform admin check
Util::adminCheck();

// Execute admin functions based on the sanitized POST variables
if (isset($SystemStatus)) {
$admin->setSystemStatus();
}
if (isset($SystemMaint)) {
$admin->setSystemMaint();
}
if (isset($SystemVersion)) {
$ver = floatval(Util::securevar($_POST["version"]));
$admin->setSystemVersion($ver);
}
if (isset($invite)) {
$admin->setinvite();
}
if (isset($Systemfreeze)) {
$admin->setSystemfreeze();
}
if (isset($flushchat)) {
$admin->flushchat();
}
if (isset($setnews)) {
$news = Util::securevar($_POST["msg"]);
$admin->setnews($news);
}
if (isset($invwave)) {
$admin->invwave();
}
if (isset($discordlinking)) {
$admin->setDiscordLink();
}
if (isset($discordrelinking)) {
$admin->setDiscordReLink();
}
if (isset($discordlogging)) {
$admin->setDiscordLogging();
}
if (isset($captcha_option)) {
$admin->setCaptchaSystem($captcha_option);
}
if (isset($setkey)) {
$admin->setCaptchaKey($setkey);
}
if (isset($setsecret)) {
$admin->setCaptchaSecret($setsecret);
}
if (isset($setcolor)) {
$admin->changeEmbedColor($setcolor);
}

// Redirect to system page after processing
header("location: index.php");
exit;
}

header("location: index.php");
exit;
}
?>

Expand Down