diff --git a/system/pages/forum/admin.php b/system/pages/forum/admin.php index 6e35bba5..1260cfb2 100644 --- a/system/pages/forum/admin.php +++ b/system/pages/forum/admin.php @@ -17,6 +17,8 @@ if(!$canEdit) { return; } +csrfProtect(); + $groupsList = new OTS_Groups_List(); $groups = [ ['id' => 0, 'name' => 'Guest'], @@ -30,23 +32,24 @@ foreach ($groupsList as $group) { } if(!empty($action)) { - if($action == 'delete_board' || $action == 'edit_board' || $action == 'hide_board' || $action == 'moveup_board' || $action == 'movedown_board') + if($action == 'delete_board' || $action == 'edit_board' || $action == 'hide_board' || $action == 'moveup_board' || $action == 'movedown_board') { $id = $_REQUEST['id']; - - if(isset($_REQUEST['access'])) { - $access = $_REQUEST['access']; } - if(isset($_REQUEST['guild'])) { - $guild = $_REQUEST['guild']; + if(isset($_POST['access'])) { + $access = $_POST['access']; } - if(isset($_REQUEST['name'])) { - $name = $_REQUEST['name']; + if(isset($_POST['guild'])) { + $guild = $_POST['guild']; } - if(isset($_REQUEST['description'])) { - $description = stripslashes($_REQUEST['description']); + if(isset($_POST['name'])) { + $name = $_POST['name']; + } + + if(isset($_POST['description'])) { + $description = stripslashes($_POST['description']); } $errors = []; @@ -55,6 +58,7 @@ if(!empty($action)) { if(Forum::add_board($name, $description, $access, $guild, $errors)) { $action = $name = $description = ''; header('Location: ' . getLink('forum')); + exit; } } else if($action == 'delete_board') { diff --git a/system/templates/forum.admin.links.html.twig b/system/templates/forum.admin.links.html.twig new file mode 100644 index 00000000..2449e616 --- /dev/null +++ b/system/templates/forum.admin.links.html.twig @@ -0,0 +1,43 @@ +
| + + + + + + + {% if i != 1 %} + + {% endif %} + {% if i != loop.last %} + + {% endif %} + | +
Edit
-
-
-
Delete
-
-
-
{% if board.hide != 1 %}Hide{% else %}Show{% endif %}
-
- {% if i != 1 %}
-
-