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;