summaryrefslogtreecommitdiffstats
path: root/modules-available/remoteaccess/inc/remoteaccess.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2022-07-25 10:58:27 +0200
committerSimon Rettberg2022-07-25 10:58:27 +0200
commitcfd4396321b6b03c6e099ea4117d8d3d1874c6f5 (patch)
tree0999616e54364c8a043f33065fee2ea10dfe5736 /modules-available/remoteaccess/inc/remoteaccess.inc.php
parent[vmstore] Benchmark: Put server list first, add fixed buttonbar at bottom (diff)
downloadslx-admin-cfd4396321b6b03c6e099ea4117d8d3d1874c6f5.tar.gz
slx-admin-cfd4396321b6b03c6e099ea4117d8d3d1874c6f5.tar.xz
slx-admin-cfd4396321b6b03c6e099ea4117d8d3d1874c6f5.zip
[remoteaccess] Don't uncheck currently disabled locations in group edit
Diffstat (limited to 'modules-available/remoteaccess/inc/remoteaccess.inc.php')
-rw-r--r--modules-available/remoteaccess/inc/remoteaccess.inc.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules-available/remoteaccess/inc/remoteaccess.inc.php b/modules-available/remoteaccess/inc/remoteaccess.inc.php
index ce6bf0db..7bd0e966 100644
--- a/modules-available/remoteaccess/inc/remoteaccess.inc.php
+++ b/modules-available/remoteaccess/inc/remoteaccess.inc.php
@@ -11,7 +11,13 @@ class RemoteAccess
const PROP_PLUGIN_VERSION = 'remoteaccess.plugin-version';
- public static function getEnabledLocations(int $group = 0)
+ /**
+ * Get a list of locationIds where remote access is enabled. If $filterOverridden is true,
+ * the list will not contain any locations where remote access is disabled via location override.
+ * @param int $group Group to get locations for, or '0' for all locations
+ * @param bool $filterOverridden iff true, remove any locations where remote access is currently disabled
+ */
+ public static function getEnabledLocations(int $group = 0, bool $filterOverridden = true): array
{
if ($group === 0) {
$list = Database::queryColumnArray("SELECT DISTINCT rxl.locationid FROM remoteaccess_x_location rxl
@@ -20,6 +26,8 @@ class RemoteAccess
$list = Database::queryColumnArray("SELECT DISTINCT locationid FROM remoteaccess_x_location
WHERE groupid = :gid", ['gid' => $group]);
}
+ if (!$filterOverridden || !Module::isAvailable('rebootcontrol'))
+ return $list;
return array_filter($list, function (int $lid) {
$mode = Scheduler::getLocationOptions($lid)['ra-mode'];
return ($mode !== Scheduler::RA_NEVER