From 368480cf0ccbf95f6540e5fda160d7fdc1236c39 Mon Sep 17 00:00:00 2001 From: Matthias Grief Date: Fri, 3 Jan 2025 17:42:39 +0100 Subject: [PATCH] =?UTF-8?q?Autorisierung=20bei=20Inhaltseditoren=20pr?= =?UTF-8?q?=C3=BCfen=20eingebaut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webseite/subjectEditor.php | 7 +++++++ webseite/topicEditor.php | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/webseite/subjectEditor.php b/webseite/subjectEditor.php index 4444838..2c89f47 100644 --- a/webseite/subjectEditor.php +++ b/webseite/subjectEditor.php @@ -3,6 +3,13 @@ require_once("classes/User.php"); require_once("classes/SubjectData.php"); require_once("classes/TopicData.php"); +session_start(); + +if (!isset($_SESSION['user']) || !$_SESSION['user']->isLoggedIn()) { + header("Location: index.php"); + die(); +} + $allSubjects = SubjectData::getAll(); $editingSubject = null; diff --git a/webseite/topicEditor.php b/webseite/topicEditor.php index 4805dcd..fa5dff5 100644 --- a/webseite/topicEditor.php +++ b/webseite/topicEditor.php @@ -1,10 +1,16 @@ isLoggedIn()) { + header("Location: index.php"); + die(); +} + $allSubjects = SubjectData::getAll(); $editingTopic = null;