summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2016-05-20 17:58:58 +0200
committerSimon Rettberg2016-05-20 17:58:58 +0200
commit856374a72b5ea4aad090a5ac30f1e97c19d46fad (patch)
tree53af30b0491c4570a9d73fe5b50acae4346b318d /modules-available/serversetup-bwlp/page.inc.php
parent[sysconfig] Merge homedir sysconfig from master branch (diff)
downloadslx-admin-856374a72b5ea4aad090a5ac30f1e97c19d46fad.tar.gz
slx-admin-856374a72b5ea4aad090a5ac30f1e97c19d46fad.tar.xz
slx-admin-856374a72b5ea4aad090a5ac30f1e97c19d46fad.zip
[serversetup-bwlp] Add usb image download button
Diffstat (limited to 'modules-available/serversetup-bwlp/page.inc.php')
-rw-r--r--modules-available/serversetup-bwlp/page.inc.php28
1 files changed, 24 insertions, 4 deletions
diff --git a/modules-available/serversetup-bwlp/page.inc.php b/modules-available/serversetup-bwlp/page.inc.php
index 9a040178..dfc61e5c 100644
--- a/modules-available/serversetup-bwlp/page.inc.php
+++ b/modules-available/serversetup-bwlp/page.inc.php
@@ -17,6 +17,10 @@ class Page_ServerSetup extends Page
Util::redirect('?do=Main');
}
+ if (Request::any('action') === 'getimage') {
+ $this->handleGetImage();
+ }
+
$this->currentMenu = Property::getBootMenu();
$action = Request::post('action');
@@ -51,14 +55,18 @@ class Page_ServerSetup extends Page
'chooseHintClass' => $this->hasIpSet ? '' : 'alert alert-danger'
));
$data = $this->currentMenu;
- if (!isset($data['defaultentry']))
+ if (!isset($data['defaultentry'])) {
$data['defaultentry'] = 'net';
- if ($data['defaultentry'] === 'net')
+ }
+ if ($data['defaultentry'] === 'net') {
$data['active-net'] = 'checked';
- if ($data['defaultentry'] === 'hdd')
+ }
+ if ($data['defaultentry'] === 'hdd') {
$data['active-hdd'] = 'checked';
- if ($data['defaultentry'] === 'custom')
+ }
+ if ($data['defaultentry'] === 'custom') {
$data['active-custom'] = 'checked';
+ }
Render::addTemplate('ipxe', $data);
}
@@ -137,4 +145,16 @@ class Page_ServerSetup extends Page
Util::redirect('?do=ServerSetup&taskid=' . $id);
}
+ private function handleGetImage()
+ {
+ $file = "/opt/openslx/ipxe/openslx-bootstick.raw";
+ if (!is_readable($file)) {
+ Message::addError('image-not-found');
+ return;
+ }
+ Header('Content-Type: application/octet-stream');
+ readfile($file);
+ exit;
+ }
+
}