summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner/baseconfig/getconfig.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2018-02-08 15:05:58 +0100
committerSimon Rettberg2018-02-08 15:05:58 +0100
commitce10ff7a848985f44e6c3c371f6075f67a8b7aeb (patch)
treea99a41c91f5b036aa28c0f9da52c640a8c6c4e2d /modules-available/roomplanner/baseconfig/getconfig.inc.php
parentUpdate translations (diff)
downloadslx-admin-ce10ff7a848985f44e6c3c371f6075f67a8b7aeb.tar.gz
slx-admin-ce10ff7a848985f44e6c3c371f6075f67a8b7aeb.tar.xz
slx-admin-ce10ff7a848985f44e6c3c371f6075f67a8b7aeb.zip
[exams/roomplanner] Hybrid PVS managers become dedicated in exam mode
Hopefully fixes #3066
Diffstat (limited to 'modules-available/roomplanner/baseconfig/getconfig.inc.php')
-rw-r--r--modules-available/roomplanner/baseconfig/getconfig.inc.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules-available/roomplanner/baseconfig/getconfig.inc.php b/modules-available/roomplanner/baseconfig/getconfig.inc.php
index f4708547..79af974b 100644
--- a/modules-available/roomplanner/baseconfig/getconfig.inc.php
+++ b/modules-available/roomplanner/baseconfig/getconfig.inc.php
@@ -1,3 +1,24 @@
<?php
ConfigHolder::add("SLX_PVS_CONFIG_URL", 'http://' . $_SERVER['SERVER_ADDR'] . $_SERVER['SCRIPT_NAME'] . '?do=roomplanner');
+
+/**
+ * Make sure we switch to dedicated mode if this is a hybrid mode
+ * manager and we're in exam mode.
+ * Also disable exam mode for any kind of manager.
+ */
+ConfigHolder::addPostHook(function() {
+ $exam = (bool)ConfigHolder::get('SLX_EXAM');
+ $hybrid = ConfigHolder::get('SLX_PVS_HYBRID') === 'yes';
+ $dedi = (bool)ConfigHolder::get('SLX_PVS_DEDICATED');
+ if ($exam) {
+ if ($dedi || $hybrid) {
+ ConfigHolder::add('SLX_EXAM', false, 100000);
+ ConfigHolder::add('SLX_SYSTEMD_TARGET', false, 100000);
+ }
+ if ($hybrid) {
+ ConfigHolder::add('SLX_PVS_HYBRID', false, 100000);
+ ConfigHolder::add('SLX_PVS_DEDICATED', 'yes', 100000);
+ }
+ }
+}); \ No newline at end of file