From 18a8055ce3b61b9765c06a37bcb25fc6b3c2ea85 Mon Sep 17 00:00:00 2001
From: Moritz Strohm <strohm@data-quest.de>
Date: Tue, 5 Nov 2024 16:20:29 +0000
Subject: [PATCH] course/enrolment: allow participants to enter locked courses,
 fixes #4822

Closes #4822

Merge request studip/studip!3612
---
 lib/models/Course.php | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/models/Course.php b/lib/models/Course.php
index 68ac7277a5b..df70b4321d9 100644
--- a/lib/models/Course.php
+++ b/lib/models/Course.php
@@ -1597,6 +1597,17 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe
             );
         }
 
+        //Check the course membership:
+
+        if ($GLOBALS['perm']->have_studip_perm('user', $this->id, $user_id)) {
+            return new \Studip\EnrolmentInformation(
+                _('Sie sind bereits in der Veranstaltung eingetragen.'),
+                \Studip\Information::INFO,
+                'already_member',
+                true
+            );
+        }
+
         //Check the course set and if the user is on an admission list:
 
         if ($course_set = $this->getCourseSet()) {
@@ -1671,17 +1682,6 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe
             );
         }
 
-        //Check the course membership:
-
-        if ($GLOBALS['perm']->have_studip_perm('user', $this->id, $user_id)) {
-            return new \Studip\EnrolmentInformation(
-                _('Sie sind bereits in der Veranstaltung eingetragen.'),
-                \Studip\Information::INFO,
-                'already_member',
-                true
-            );
-        }
-
         //Check the admission status:
 
         $admission_status = $user->admission_applications->findBy('seminar_id', $this->id)->val('status');
-- 
GitLab