diff options
author | Simon Rettberg | 2020-11-04 09:09:54 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-11-04 09:09:54 +0100 |
commit | 598d4005ab9889e949bb1aca46716d7f4477db99 (patch) | |
tree | 4139429d9053545f4b567c4e7bf40864b0396c73 /modules-available/serversetup-bwlp-ipxe/api.inc.php | |
parent | [locationinfo] ical: Fix undefined index access (diff) | |
download | slx-admin-598d4005ab9889e949bb1aca46716d7f4477db99.tar.gz slx-admin-598d4005ab9889e949bb1aca46716d7f4477db99.tar.xz slx-admin-598d4005ab9889e949bb1aca46716d7f4477db99.zip |
[serversetup-bwlp-ipxe] Re-interoduce direct boot for one-item menus
Menus with only one item and a timeout of 0 will directly boot the
entry.
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/api.inc.php')
-rw-r--r-- | modules-available/serversetup-bwlp-ipxe/api.inc.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/api.inc.php b/modules-available/serversetup-bwlp-ipxe/api.inc.php index 1ac885df..4ca9fdec 100644 --- a/modules-available/serversetup-bwlp-ipxe/api.inc.php +++ b/modules-available/serversetup-bwlp-ipxe/api.inc.php @@ -29,7 +29,18 @@ } else { $menu = IPxeMenu::forClient($builder->clientIp(), $builder->uuid()); } - $data = $builder->getMenu($menu, true); + $data = null; + if ($menu->itemCount() === 1 && $menu->timeoutMs() === 0) { + // One entry, no timeout -- direct boot + $entry = $menu->defaultEntry(); + if ($entry !== null) { + $data = $builder->getMenuEntry($entry); + } + } + if ($data === null) { + // Show menu + $data = $builder->getMenu($menu, true); + } } } $builder->output($data); |