summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-28 11:07:02 +0100
committerSimon Rettberg2019-02-28 11:07:02 +0100
commita155dacb5513271b8c8551e2938082658f21970e (patch)
tree6b84f794844ceca8ebca2416c9ef04bceb5910af /modules-available/serversetup-bwlp-ipxe/page.inc.php
parent[serversetup-bwlp-ipxe] Change bwlp-default; add splash screen (diff)
downloadslx-admin-a155dacb5513271b8c8551e2938082658f21970e.tar.gz
slx-admin-a155dacb5513271b8c8551e2938082658f21970e.tar.xz
slx-admin-a155dacb5513271b8c8551e2938082658f21970e.zip
[serversetup-bwlp-ipxe] Fix boot entry management
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/page.inc.php')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/page.inc.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/page.inc.php b/modules-available/serversetup-bwlp-ipxe/page.inc.php
index 6f95d754..07683df3 100644
--- a/modules-available/serversetup-bwlp-ipxe/page.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/page.inc.php
@@ -271,8 +271,8 @@ class Page_ServerSetup extends Page
{
$allowEdit = User::hasPermission('ipxe.bootentry.edit');
- $res = Database::simpleQuery("SELECT be.entryid, be.hotkey, be.title, be.builtin, Count(*) AS refs FROM serversetup_bootentry be
- INNER JOIN serversetup_menuentry sm USING (entryid)
+ $res = Database::simpleQuery("SELECT be.entryid, be.hotkey, be.title, be.builtin, Count(sm.menuid) AS refs FROM serversetup_bootentry be
+ LEFT JOIN serversetup_menuentry sm USING (entryid)
GROUP BY be.entryid
ORDER BY be.title ASC");
$bootentryTable = [];
@@ -438,7 +438,7 @@ class Page_ServerSetup extends Page
}
$entry->addFormFields($params);
$params['title'] = $row['title'];
- $params['entryid'] = $row['entryid'];
+ $params['oldentryid'] = $params['entryid'] = $row['entryid'];
$params['builtin'] = $row['builtin'];
$params['menus'] = Database::queryAll('SELECT m.menuid, m.title FROM serversetup_menu m
INNER JOIN serversetup_menuentry me ON (me.menuid = m.menuid)
@@ -495,15 +495,16 @@ class Page_ServerSetup extends Page
return true;
}
- private function deleteBootEntry() {
+ private function deleteBootEntry()
+ {
$id = Request::post('deleteid', false, 'string');
if ($id === false) {
Message::addError('main.parameter-missing', 'deleteid');
return;
}
Database::exec("DELETE FROM serversetup_bootentry WHERE entryid = :entryid", array("entryid" => $id));
- // TODO: Redirect to &show=bootentry
Message::addSuccess('bootentry-deleted');
+ Util::redirect('?do=serversetup&show=bootentry');
}
private function setDefaultMenu()