diff options
author | Simon Rettberg | 2018-02-08 15:05:58 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-02-08 15:05:58 +0100 |
commit | ce10ff7a848985f44e6c3c371f6075f67a8b7aeb (patch) | |
tree | a99a41c91f5b036aa28c0f9da52c640a8c6c4e2d /modules-available/roomplanner/baseconfig/getconfig.inc.php | |
parent | Update translations (diff) | |
download | slx-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.php | 21 |
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 |