From 766d3519522fed8282ca31df50c9dd57f8ca26e6 Mon Sep 17 00:00:00 2001
From: Rasmus Fuhse <fuhse@data-quest.de>
Date: Mon, 13 Feb 2023 15:20:06 +0100
Subject: [PATCH] bugfixing illegal copying

---
 controllers/copy.php | 4 +++-
 plugin.manifest      | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/controllers/copy.php b/controllers/copy.php
index 67dcff3..804e6b8 100755
--- a/controllers/copy.php
+++ b/controllers/copy.php
@@ -83,7 +83,9 @@ class CopyController extends PluginController
                 foreach ($course_ids as $course_id) {
                     $oldcourse = Course::find($course_id);
 
-                    if ($oldcourse && Seminar_Perm::get()->have_studip_perm('dozent', $course_id)) {
+                    if ($oldcourse
+                            && Seminar_Perm::get()->have_studip_perm('dozent', $course_id)
+                            && !LockRules::check($course_id, 'seminar_copy')) {
                         $newcourse = new Course();
                         $newcourse->setData($oldcourse->toArray());
                         if ($newcourse['parent_course']) {
diff --git a/plugin.manifest b/plugin.manifest
index 3921d09..ca81a46 100755
--- a/plugin.manifest
+++ b/plugin.manifest
@@ -1,6 +1,6 @@
 pluginname=CourseCopy
 pluginclassname=CourseCopy
-version=1.9.2
+version=1.9.3
 origin=data-quest
 studipMinVersion=4.0
-studipMaxVersion=5.1.99
+studipMaxVersion=5.3.99
-- 
GitLab