From e9e032feb9a916b0b90538227bb26f0fa0c1e02d Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Wed, 20 Apr 2022 16:03:13 +0000
Subject: [PATCH] consultation: redirect to administration if user may edit the
 dates and visits...

Closes #931
---
 app/controllers/consultation/overview.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/controllers/consultation/overview.php b/app/controllers/consultation/overview.php
index 8f80d26131d..e7456da5d9a 100644
--- a/app/controllers/consultation/overview.php
+++ b/app/controllers/consultation/overview.php
@@ -14,6 +14,10 @@ class Consultation_OverviewController extends ConsultationController
     {
         parent::before_filter($action, $args);
 
+        if ($this->range->isEditableByUser()) {
+            $this->redirect('consultation/admin');
+        }
+
         PageLayout::setTitle(sprintf(
             '%s: %s',
             $this->getConsultationTitle(),
-- 
GitLab