summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-12-04 16:24:21 +0100
committerSimon Rettberg2023-12-04 16:24:21 +0100
commit219b45bbde5ef281f12216f88006f8db7c8f238f (patch)
treee4ab69adee3c409776ca4522626fcbee0f7034e3
parent[locations] Fix wrong variable type error (diff)
downloadslx-admin-219b45bbde5ef281f12216f88006f8db7c8f238f.tar.gz
slx-admin-219b45bbde5ef281f12216f88006f8db7c8f238f.tar.xz
slx-admin-219b45bbde5ef281f12216f88006f8db7c8f238f.zip
[roomplanner] Fix invalid array key access
-rw-r--r--modules-available/roomplanner/page.inc.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules-available/roomplanner/page.inc.php b/modules-available/roomplanner/page.inc.php
index 6708cd8a..902df139 100644
--- a/modules-available/roomplanner/page.inc.php
+++ b/modules-available/roomplanner/page.inc.php
@@ -83,10 +83,12 @@ class Page_Roomplanner extends Page
FROM location_roomplan
WHERE locationid = :locationid', ['locationid' => $this->locationid]);
if ($config === false) {
- $config = ['dedicatedmgr' => false, 'managerip' => ''];
+ $config = ['managerip' => '', 'tutoruuid' => ''];
}
$runmode = RunMode::getForMode(Page::getModule(), $this->locationid, true);
- if (!empty($runmode)) {
+ if (empty($runmode)) {
+ $config['dedicatedmgr'] = false;
+ } else {
$runmode = array_pop($runmode);
$config['managerip'] = $runmode['clientip'];
$config['manageruuid'] = $runmode['machineuuid'];
@@ -95,7 +97,7 @@ class Page_Roomplanner extends Page
}
$furniture = $this->getFurniture($config);
$subnetMachines = $this->getPotentialMachines();
- $machinesOnPlan = $this->getMachinesOnPlan($config['tutoruuid'] ?? '');
+ $machinesOnPlan = $this->getMachinesOnPlan($config['tutoruuid']);
$roomConfig = array_merge($furniture, $machinesOnPlan);
$canEdit = User::hasPermission('edit', $this->locationid);
$params = [