summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp/page.inc.php
diff options
context:
space:
mode:
authorUdo Walter2017-12-27 18:25:34 +0100
committerUdo Walter2017-12-27 18:25:34 +0100
commit37e4ff35a2b40cd8513e4f06df720668ba7fa661 (patch)
tree92d638c687c8ff1e9093528066cf37d54eca5e6e /modules-available/serversetup-bwlp/page.inc.php
parent[permissionmanager] bugfix + added locationid 0 to the getAllowedLocations (diff)
downloadslx-admin-37e4ff35a2b40cd8513e4f06df720668ba7fa661.tar.gz
slx-admin-37e4ff35a2b40cd8513e4f06df720668ba7fa661.tar.xz
slx-admin-37e4ff35a2b40cd8513e4f06df720668ba7fa661.zip
[serversetup-bwlp] added permissions to edit boot address and menu and
to download the usb image
Diffstat (limited to 'modules-available/serversetup-bwlp/page.inc.php')
-rw-r--r--modules-available/serversetup-bwlp/page.inc.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/modules-available/serversetup-bwlp/page.inc.php b/modules-available/serversetup-bwlp/page.inc.php
index a8d29d6e..16d3f8e2 100644
--- a/modules-available/serversetup-bwlp/page.inc.php
+++ b/modules-available/serversetup-bwlp/page.inc.php
@@ -12,12 +12,12 @@ class Page_ServerSetup extends Page
{
User::load();
- if (!User::hasPermission('superadmin')) {
+ if (!User::isLoggedIn()) {
Message::addError('main.no-permission');
Util::redirect('?do=Main');
}
- if (Request::any('action') === 'getimage') {
+ if (Request::any('action') === 'getimage' && User::hasPermission("download")) {
$this->handleGetImage();
}
@@ -30,13 +30,13 @@ class Page_ServerSetup extends Page
$this->getLocalAddresses();
}
- if ($action === 'ip') {
+ if ($action === 'ip' && User::hasPermission("edit.address")) {
// New address is to be set
$this->getLocalAddresses();
$this->updateLocalAddress();
}
- if ($action === 'ipxe') {
+ if ($action === 'ipxe' && User::hasPermission("edit.menu")) {
// iPXE stuff changes
$this->updatePxeMenu();
}
@@ -52,7 +52,8 @@ class Page_ServerSetup extends Page
Render::addTemplate('ipaddress', array(
'ips' => $this->taskStatus['data']['addresses'],
- 'chooseHintClass' => $this->hasIpSet ? '' : 'alert alert-danger'
+ 'chooseHintClass' => $this->hasIpSet ? '' : 'alert alert-danger',
+ 'editAllowed' => User::hasPermission("edit.address"),
));
$data = $this->currentMenu;
if (!isset($data['defaultentry'])) {
@@ -67,6 +68,8 @@ class Page_ServerSetup extends Page
if ($data['defaultentry'] === 'custom') {
$data['active-custom'] = 'checked';
}
+ $data['editAllowed'] = User::hasPermission("edit.menu");
+ $data['downloadAllowed'] = User::hasPermission("download");
Render::addTemplate('ipxe', $data);
}