Fixes regarding csrf + refactor some parts of AAC (guilds + forum)

Replace $account_logged->getPlayers() with getPlayersList()
$_REQUEST['todo'] -> $_REQUEST['post']
$guild_errors -> $errors
This commit is contained in:
slawkens
2025-05-24 11:42:42 +02:00
parent e776bd52be
commit 84d502bf10
42 changed files with 301 additions and 272 deletions

View File

@@ -18,22 +18,22 @@ if ($ret === false) {
return;
}
csrfProtect();
if(!$logged) {
echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . urlencode(getLink('forum')) . '">Log in</a> to post on the forum.<br /><br />';
return;
}
csrfProtect();
if(!Forum::isModerator()) {
echo 'You are not logged in or you are not moderator.';
return;
}
$save = isset($_REQUEST['save']) && (int)$_REQUEST['save'] == 1;
$save = isset($_POST['save']) && (int)$_POST['save'] == 1;
if($save) {
$post_id = (int)$_REQUEST['id'];
$board = (int)$_REQUEST['section'];
$post_id = (int)$_POST['id'];
$board = (int)$_POST['section'];
if(!Forum::hasAccess($board)) {
$errors[] = "You don't have access to this board.";
displayErrorBoxWithBackButton($errors, getLink('forum'));