summaryrefslogtreecommitdiffstats
path: root/modules-available/dozmod/inc/pagemailtemplates.inc.php
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/pagemailtemplates.inc.php
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/pagemailtemplates.inc.php')
-rw-r--r--modules-available/dozmod/inc/pagemailtemplates.inc.php16
1 files changed, 14 insertions, 2 deletions
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');