diff options
author | Simon Rettberg | 2022-06-10 11:33:58 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-06-10 11:33:58 +0200 |
commit | 677210edcba8bfbae9bfa5505ead88f1cdfd70aa (patch) | |
tree | bbc3015c83e2540bcf95da816fdd4221b320a7ce /modules-available | |
parent | [minilinux] Add option to force another DHCP request in initramfs (diff) | |
download | slx-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')
-rw-r--r-- | modules-available/rebootcontrol/page.inc.php | 8 | ||||
-rw-r--r-- | modules-available/rebootcontrol/pages/task.inc.php | 3 |
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'); |