From 97aefcf975f23dc7cd453622da27c76a788e9bd2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 17 Sep 2020 16:32:41 +0200 Subject: [exams/runmode/remoteaccess] Tweak baseconfig hook (runmode/format) --- .../remoteaccess/baseconfig/getconfig.inc.php | 38 +++++++++++++--------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'modules-available/remoteaccess') 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 @@ $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 -- cgit v1.2.3-55-g7522