diff options
author | Simon Rettberg | 2020-09-17 16:32:41 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-09-17 16:32:41 +0200 |
commit | 97aefcf975f23dc7cd453622da27c76a788e9bd2 (patch) | |
tree | e0aedb3bd033a3dc5288a5d4ccd8b90c727fd51b /modules-available | |
parent | [locations] install: Make openingtime migration a bit more robust (diff) | |
download | slx-admin-97aefcf975f23dc7cd453622da27c76a788e9bd2.tar.gz slx-admin-97aefcf975f23dc7cd453622da27c76a788e9bd2.tar.xz slx-admin-97aefcf975f23dc7cd453622da27c76a788e9bd2.zip |
[exams/runmode/remoteaccess] Tweak baseconfig hook (runmode/format)
Diffstat (limited to 'modules-available')
3 files changed, 26 insertions, 19 deletions
diff --git a/modules-available/exams/baseconfig/getconfig.inc.php b/modules-available/exams/baseconfig/getconfig.inc.php index 10aa1d84..e7e38a33 100644 --- a/modules-available/exams/baseconfig/getconfig.inc.php +++ b/modules-available/exams/baseconfig/getconfig.inc.php @@ -22,6 +22,7 @@ $foofoo = function($machineUuid) { ConfigHolder::add('SLX_AUTOLOGIN', $autoLogin, 10000); } ConfigHolder::add('SLX_SYSTEMD_TARGET', 'exam-mode', 10000); + ConfigHolder::add('SLX_RUNMODE_MODULE', 'exams', 10000); } }; diff --git a/modules-available/remoteaccess/baseconfig/getconfig.inc.php b/modules-available/remoteaccess/baseconfig/getconfig.inc.php index 8aa6430e..4d54c183 100644 --- a/modules-available/remoteaccess/baseconfig/getconfig.inc.php +++ b/modules-available/remoteaccess/baseconfig/getconfig.inc.php @@ -1,21 +1,29 @@ <?php -// Locations from closest to furthest (order) -$locationId = ConfigHolder::get('SLX_LOCATIONS'); -if ($locationId !== false) { - $locationId = (int)$locationId; - $ret = Database::queryFirst("SELECT l.locationid FROM remoteaccess_x_location l +(function ($machineUuid) { + // Leave clients in any runmode alone + $res = Database::queryFirst('SELECT machineuuid FROM runmode WHERE machineuuid = :uuid', + array('uuid' => $machineUuid), true); + if (is_array($res)) + return; + + // Locations from closest to furthest (order) + $locationId = ConfigHolder::get('SLX_LOCATIONS'); + if ($locationId !== false) { + $locationId = (int)$locationId; + $ret = Database::queryFirst("SELECT l.locationid FROM remoteaccess_x_location l INNER JOIN remoteaccess_group g USING (groupid) WHERE locationid = :lid AND g.active = 1", - ['lid' => $locationId], true); // TODO Remove true after next point release (2020-05-12) - if ($ret !== false) { - // TODO Properly merge - if (Property::get(RemoteAccess::PROP_TRY_VIRT_HANDOVER)) { - ConfigHolder::add("SLX_REMOTE_VNC", 'vmware virtualbox'); - } else { - ConfigHolder::add("SLX_REMOTE_VNC", 'x11vnc'); + ['lid' => $locationId], true); // TODO Remove true after next point release (2020-05-12) + if ($ret !== false) { + // TODO Properly merge + if (Property::get(RemoteAccess::PROP_TRY_VIRT_HANDOVER)) { + ConfigHolder::add("SLX_REMOTE_VNC", 'vmware virtualbox'); + } else { + ConfigHolder::add("SLX_REMOTE_VNC", 'x11vnc'); + } + ConfigHolder::add("SLX_REMOTE_HOST_ACCESS", Property::get(RemoteAccess::PROP_ALLOWED_VNC_NET)); + ConfigHolder::add('SLX_RUNMODE_MODULE', 'remoteaccess'); } - ConfigHolder::add("SLX_REMOTE_HOST_ACCESS", Property::get(RemoteAccess::PROP_ALLOWED_VNC_NET)); - ConfigHolder::add('SLX_RUNMODE_MODULE', 'remoteaccess'); } -} +})($uuid);
\ No newline at end of file diff --git a/modules-available/runmode/baseconfig/getconfig.inc.php b/modules-available/runmode/baseconfig/getconfig.inc.php index 8ea2b2a6..9c36cc75 100644 --- a/modules-available/runmode/baseconfig/getconfig.inc.php +++ b/modules-available/runmode/baseconfig/getconfig.inc.php @@ -1,6 +1,6 @@ <?php -$foofoo = function($machineUuid) { +(function($machineUuid) { $res = Database::queryFirst('SELECT module, modeid, modedata FROM runmode WHERE machineuuid = :uuid', array('uuid' => $machineUuid)); if ($res === false) @@ -17,6 +17,4 @@ $foofoo = function($machineUuid) { ConfigHolder::add('SLX_SYSTEMD_TARGET', $config->systemdDefaultTarget, 10000); } ConfigHolder::add('SLX_RUNMODE_MODULE', $res['module']); -}; - -$foofoo($uuid);
\ No newline at end of file +})($uuid); |