aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/course/courseware.php
diff options
context:
space:
mode:
authorElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2023-08-15 11:25:56 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2023-08-15 11:25:56 +0000
commitb8cb95a5b4e203f178f4e31c50e951242d25d86b (patch)
treed9b40843f949f1aa15e24cbc5242deda1ee6021c /app/controllers/course/courseware.php
parentf432e2ecac0eb0a524238c4b74f3305d1625187f (diff)
don't offer OER actions when module is disabled, fixes #2769
Closes #2769 Merge request studip/studip!2027
Diffstat (limited to 'app/controllers/course/courseware.php')
-rw-r--r--app/controllers/course/courseware.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/course/courseware.php b/app/controllers/course/courseware.php
index 29c48d9..46419a8 100644
--- a/app/controllers/course/courseware.php
+++ b/app/controllers/course/courseware.php
@@ -31,6 +31,7 @@ class Course_CoursewareController extends CoursewareController
object_set_visit_module($this->studip_module->getPluginId());
$this->last_visitdate = object_get_visit(Context::getId(), $this->studip_module->getPluginId());
$this->licenses = $this->getLicenses();
+ $this->oer_enabled = Config::get()->OERCAMPUS_ENABLED && $GLOBALS['perm']->have_perm(Config::get()->OER_PUBLIC_STATUS);
$this->unitsNotFound = Unit::countBySql('range_id = ?', [Context::getId()]) === 0;
}
@@ -42,7 +43,7 @@ class Course_CoursewareController extends CoursewareController
public function courseware_action($unit_id = null): void
{
- global $perm, $user;
+ global $user;
Navigation::activateItem('course/courseware/unit');
if ($this->unitsNotFound) {
PageLayout::postMessage(MessageBox::info(_('Es wurde kein Lernmaterial gefunden.')));