blob: 23e623d0f7c2788f364ece27919ba8feea401f05 (
plain) (
tree)
|
|
<?php
(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');
}
ConfigHolder::add("SLX_REMOTE_HOST_ACCESS", Property::get(RemoteAccess::PROP_ALLOWED_VNC_NET));
ConfigHolder::add('SLX_REMOTE_VNC_PORT', Property::get(RemoteAccess::PROP_VNC_PORT, 5900));
ConfigHolder::add('SLX_RUNMODE_MODULE', 'remoteaccess');
// No saver
$saverTimeout = ConfigHolder::get('SLX_SCREEN_SAVER_TIMEOUT');
if (!is_numeric($saverTimeout) || $saverTimeout < 1800) {
ConfigHolder::add('SLX_SCREEN_SAVER_TIMEOUT', '1800', 1000);
}
ConfigHolder::add('SLX_SCREEN_SAVER_GRACE_TIME', '86400', 1000);
}
}
})($uuid);
|