summaryrefslogtreecommitdiffstats
path: root/modules-available/remoteaccess
diff options
context:
space:
mode:
authorSimon Rettberg2022-04-29 17:38:00 +0200
committerSimon Rettberg2022-04-29 17:38:00 +0200
commit140062e0b606495f90fd77b8f290987844c79cab (patch)
treead32ce72580fa898f447c66316587ee7404e9854 /modules-available/remoteaccess
parent[baseconfig_bwlp] Add more HDMI outputs for sound card (diff)
downloadslx-admin-140062e0b606495f90fd77b8f290987844c79cab.tar.gz
slx-admin-140062e0b606495f90fd77b8f290987844c79cab.tar.xz
slx-admin-140062e0b606495f90fd77b8f290987844c79cab.zip
[locations/remoteaccess] Add option to veto remoteaccess mode
Remoteaccess mode can now be forced to be disabled for individual locations in locations module, either unconditionally, or whenever the openingtimes schedule says the room is open. A reboot will be triggered whenever the room opens/closes to force clients into the proper runmode.
Diffstat (limited to 'modules-available/remoteaccess')
-rw-r--r--modules-available/remoteaccess/baseconfig/getconfig.inc.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules-available/remoteaccess/baseconfig/getconfig.inc.php b/modules-available/remoteaccess/baseconfig/getconfig.inc.php
index 3d0c4470..84923dc6 100644
--- a/modules-available/remoteaccess/baseconfig/getconfig.inc.php
+++ b/modules-available/remoteaccess/baseconfig/getconfig.inc.php
@@ -18,6 +18,15 @@
['lid' => $locationId], true); // TODO Remove true after next point release (2020-05-12)
if ($ret === false)
return;
+ // Special case – location admin can limit accessibility of this machine to never, or only when room is closed
+ $opts = Scheduler::getLocationOptions($locationId);
+ if ($opts['ra-mode'] === Scheduler::RA_NEVER)
+ return; // Completely disallowed
+ if ($opts['ra-mode'] === Scheduler::RA_SELECTIVE) {
+ // Only when room is closed
+ if (OpeningTimes::isRoomOpen($locationId, $opts['wol-offset'], $opts['sd-offset']))
+ return; // Open, do not interfere with ongoing lectures etc., do nothing
+ }
// TODO Properly merge
if (Property::get(RemoteAccess::PROP_TRY_VIRT_HANDOVER)) {
ConfigHolder::add("SLX_REMOTE_VNC", 'vmware virtualbox');