summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-02 15:23:56 +0200
committerSimon Rettberg2022-05-02 15:23:56 +0200
commita83cc6cec97358a9037a84db229a45734c9ba8d1 (patch)
treea35ac9b7f0a5b09838fe425c7bcb5a001b3f6c69 /modules-available/serversetup-bwlp-ipxe
parent[serversetup-bwlp-ipxe] Remove dead code (diff)
downloadslx-admin-a83cc6cec97358a9037a84db229a45734c9ba8d1.tar.gz
slx-admin-a83cc6cec97358a9037a84db229a45734c9ba8d1.tar.xz
slx-admin-a83cc6cec97358a9037a84db229a45734c9ba8d1.zip
[serversetup-bwlp-ipxe] Fix pvsmgr hack (accessed wrong field)
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php
index 4968595f..7d15cd99 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php
@@ -15,6 +15,9 @@ class IPxeMenu
* @var string title to display above menu
*/
public $title;
+ /**
+ * @var int menu entry id from DB
+ */
public $defaultEntryId;
/**
* @var MenuEntry[]
@@ -45,7 +48,7 @@ class IPxeMenu
$this->menuid = (int)$menu['menuid'];
$this->timeoutMs = (int)$menu['timeoutms'];
$this->title = (string)$menu['title'];
- $this->defaultEntryId = $menu['defaultentryid'];
+ $defaultEntryId = $menu['defaultentryid'];
$res = Database::simpleQuery("SELECT e.menuentryid, e.entryid, e.refmenuid, e.hotkey, e.title,
e.hidden, e.sortval, e.md5pass, b.module, b.data AS bootentry, b.title AS betitle
FROM serversetup_menuentry e
@@ -56,9 +59,10 @@ class IPxeMenu
$this->items[] = new MenuEntry($row);
}
// Make sure we have a default entry if the menu isn't empty
- if ($this->defaultEntryId === null && !empty($this->items)) {
- $this->defaultEntryId = $this->items[0]->menuEntryId();
+ if ($defaultEntryId === null && !empty($this->items)) {
+ $defaultEntryId = $this->items[0]->menuEntryId();
}
+ $this->defaultEntryId = (int)$defaultEntryId;
}
public function title(): string
@@ -85,7 +89,7 @@ class IPxeMenu
public function defaultEntry()
{
foreach ($this->items as $item) {
- if ($item->menuEntryId() == $this->defaultEntryId)
+ if ($item->menuEntryId() === $this->defaultEntryId)
return $item;
}
return null;
@@ -107,7 +111,7 @@ class IPxeMenu
if ($rm === false)
return;
// Is not pvsmgr
- if ($rm['modeid'] !== 'roomplanner')
+ if ($rm['module'] !== 'roomplanner')
return;
// See if it's a dedicated station, if so make sure it boots into bwLehrpool
$data = json_decode($rm['modedata'], true);