diff options
author | Christian Hofmaier | 2017-10-27 16:49:13 +0200 |
---|---|---|
committer | Christian Hofmaier | 2017-10-27 16:49:13 +0200 |
commit | f8778f213cb9f916fa56279c9e1cf6deb067b35c (patch) | |
tree | 4d951d85dab1a015ef120f189a229ed734f1ce32 /modules-available/dozmod/inc/pagemailtemplates.inc.php | |
parent | [internetaccess] user is now checked if he's logged in before he can access t... (diff) | |
download | slx-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.php | 16 |
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§ion=templates'); + } } elseif ($action === 'reset') { - $this->handleReset(); + if(User::hasPermission("templates.reset")) { + $this->handleReset(); + } else { + Message::addError('main.no-permission'); + Util::redirect('?do=dozmod§ion=templates'); + } } else { Message::addError('main.invalid-action', $action); Util::redirect('?do=dozmod§ion=templates'); |