mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-17 03:03:26 +02:00
Forum: better error messages (Suggested by @anyeor)
This commit is contained in:
@@ -14,12 +14,13 @@ if(!Forum::isModerator()) {
|
||||
echo 'You are not logged in or you are not moderator.';
|
||||
}
|
||||
|
||||
$save = isset($_REQUEST['save']) ? (int)$_REQUEST['save'] == 1 : false;
|
||||
$save = isset($_REQUEST['save']) && (int)$_REQUEST['save'] == 1;
|
||||
if($save) {
|
||||
$post_id = (int)$_REQUEST['id'];
|
||||
$board = (int)$_REQUEST['section'];
|
||||
if(!Forum::hasAccess($board)) {
|
||||
echo "You don't have access to this board.";
|
||||
$errors[] = "You don't have access to this board.";
|
||||
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -31,8 +32,10 @@ if($save) {
|
||||
header('Location: ' . getForumBoardLink($nPost['section']));
|
||||
}
|
||||
}
|
||||
else
|
||||
echo 'Post with ID ' . $post_id . ' does not exist.';
|
||||
else {
|
||||
$errors[] = 'Post with ID ' . $post_id . ' does not exist.';
|
||||
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$post_id = (int)$_REQUEST['id'];
|
||||
@@ -58,7 +61,8 @@ else {
|
||||
));
|
||||
}
|
||||
}
|
||||
else
|
||||
echo 'Post with ID ' . $post_id . ' does not exist.';
|
||||
else {
|
||||
$errors[] = 'Post with ID ' . $post_id . ' does not exist.';
|
||||
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user