From 21f741c44215044c162fc1f0044bcbc052004d2e Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Mon, 6 May 2024 06:49:27 +0000
Subject: [PATCH] fixes #4112

Closes #4112

Merge request studip/studip!2957
---
 app/controllers/accessibility/forms.php | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/app/controllers/accessibility/forms.php b/app/controllers/accessibility/forms.php
index f4f9adf7ef7..476f2fecc89 100644
--- a/app/controllers/accessibility/forms.php
+++ b/app/controllers/accessibility/forms.php
@@ -3,6 +3,21 @@ class Accessibility_FormsController extends StudipController
 {
     protected $with_session = true;
 
+    public function before_filter(&$action, &$args)
+    {
+        parent::before_filter($action, $args);
+
+        if (
+            Config::get()->REPORT_BARRIER_MODE === 'off'
+            || (
+                Config::get()->REPORT_BARRIER_MODE === 'logged-in'
+                && !User::findCurrent()
+            )
+        ) {
+            throw new AccessDeniedException();
+        }
+    }
+
     public function report_barrier_action()
     {
         PageLayout::setTitle(_('Barriere melden'));
-- 
GitLab