summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol
diff options
context:
space:
mode:
authorSimon Rettberg2022-06-10 11:33:58 +0200
committerSimon Rettberg2022-06-10 11:33:58 +0200
commit677210edcba8bfbae9bfa5505ead88f1cdfd70aa (patch)
treebbc3015c83e2540bcf95da816fdd4221b320a7ce /modules-available/rebootcontrol
parent[minilinux] Add option to force another DHCP request in initramfs (diff)
downloadslx-admin-677210edcba8bfbae9bfa5505ead88f1cdfd70aa.tar.gz
slx-admin-677210edcba8bfbae9bfa5505ead88f1cdfd70aa.tar.xz
slx-admin-677210edcba8bfbae9bfa5505ead88f1cdfd70aa.zip
[rebootcontrol] Show error message if user has no action.* permission
Diffstat (limited to 'modules-available/rebootcontrol')
-rw-r--r--modules-available/rebootcontrol/page.inc.php8
-rw-r--r--modules-available/rebootcontrol/pages/task.inc.php3
2 files changed, 10 insertions, 1 deletions
diff --git a/modules-available/rebootcontrol/page.inc.php b/modules-available/rebootcontrol/page.inc.php
index b84b4d9a..872f27d4 100644
--- a/modules-available/rebootcontrol/page.inc.php
+++ b/modules-available/rebootcontrol/page.inc.php
@@ -65,7 +65,13 @@ class Page_RebootControl extends Page
if (Request::isPost()) {
Util::redirect('?do=rebootcontrol' . ($section ? '&show=' . $section : ''));
} elseif ($section === false) {
- Util::redirect('?do=rebootcontrol&show=task');
+ if (User::hasPermission('action.*')) {
+ Util::redirect('?do=rebootcontrol&show=task');
+ } elseif (User::hasPermission('jumphost.*')) {
+ Util::redirect('?do=rebootcontrol&show=jumphost');
+ } else {
+ Util::redirect('?do=rebootcontrol&show=subnet');
+ }
}
}
diff --git a/modules-available/rebootcontrol/pages/task.inc.php b/modules-available/rebootcontrol/pages/task.inc.php
index 0e770618..933c7721 100644
--- a/modules-available/rebootcontrol/pages/task.inc.php
+++ b/modules-available/rebootcontrol/pages/task.inc.php
@@ -104,6 +104,9 @@ class SubPage
Render::addTemplate('task-header');
// Append list of active reboot/shutdown tasks
$allowedLocs = User::getAllowedLocations("action.*");
+ if (empty($allowedLocs)) {
+ User::assertPermission('action.*');
+ }
$active = RebootControl::getActiveTasks($allowedLocs);
if (empty($active)) {
Message::addInfo('no-current-tasks');