summaryrefslogtreecommitdiffstats
path: root/modules-available/dozmod/inc
diff options
context:
space:
mode:
authorChristian Hofmaier2017-10-27 16:49:13 +0200
committerChristian Hofmaier2017-10-27 16:49:13 +0200
commitf8778f213cb9f916fa56279c9e1cf6deb067b35c (patch)
tree4d951d85dab1a015ef120f189a229ed734f1ce32 /modules-available/dozmod/inc
parent[internetaccess] user is now checked if he's logged in before he can access t... (diff)
downloadslx-admin-f8778f213cb9f916fa56279c9e1cf6deb067b35c.tar.gz
slx-admin-f8778f213cb9f916fa56279c9e1cf6deb067b35c.tar.xz
slx-admin-f8778f213cb9f916fa56279c9e1cf6deb067b35c.zip
[dozmod] implemented new permission system to module for: deleting expired vm versions, sending testmails and saving mailconfig, resetting templates or saving them, saving runtimeconfig, giving users rights (when no permission, it will show another animation). Also fixed a design issue (dialog instead of modal).
Diffstat (limited to 'modules-available/dozmod/inc')
-rw-r--r--modules-available/dozmod/inc/pagedozmodusers.inc.php15
-rw-r--r--modules-available/dozmod/inc/pagemailtemplates.inc.php16
2 files changed, 27 insertions, 4 deletions
diff --git a/modules-available/dozmod/inc/pagedozmodusers.inc.php b/modules-available/dozmod/inc/pagedozmodusers.inc.php
index 8da07923..621f7d34 100644
--- a/modules-available/dozmod/inc/pagedozmodusers.inc.php
+++ b/modules-available/dozmod/inc/pagedozmodusers.inc.php
@@ -16,11 +16,22 @@ class Page_dozmod_users extends Page
protected function doAjax()
{
+ User::load();
+
$action = Request::post('action', '', 'string');
if ($action === 'setmail' || $action === 'setsu' || $action == 'setlogin') {
- $this->setUserOption($action);
+ if (User::hasPermission("users.".$action)) {
+ $this->setUserOption($action);
+ } else {
+ die("No permission.");
+ }
+
} elseif ($action === 'setorglogin') {
- $this->setOrgOption($action);
+ if (User::hasPermission("users.orglogin")) {
+ $this->setOrgOption($action);
+ } else {
+ die("No permission.");
+ }
} else {
die('No such action');
}
diff --git a/modules-available/dozmod/inc/pagemailtemplates.inc.php b/modules-available/dozmod/inc/pagemailtemplates.inc.php
index dc41d8c6..90734a50 100644
--- a/modules-available/dozmod/inc/pagemailtemplates.inc.php
+++ b/modules-available/dozmod/inc/pagemailtemplates.inc.php
@@ -7,13 +7,25 @@ class Page_mail_templates extends Page
protected function doPreprocess()
{
+ User::load();
+
$action = Request::post('action', 'show', 'string');
if ($action === 'show') {
$this->fetchTemplates();
} elseif ($action === 'save') {
- $this->handleSave();
+ if (User::hasPermission("templates.save")) {
+ $this->handleSave();
+ } else {
+ Message::addError('main.no-permission');
+ Util::redirect('?do=dozmod&section=templates');
+ }
} elseif ($action === 'reset') {
- $this->handleReset();
+ if(User::hasPermission("templates.reset")) {
+ $this->handleReset();
+ } else {
+ Message::addError('main.no-permission');
+ Util::redirect('?do=dozmod&section=templates');
+ }
} else {
Message::addError('main.invalid-action', $action);
Util::redirect('?do=dozmod&section=templates');