diff options
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 |