From f8778f213cb9f916fa56279c9e1cf6deb067b35c Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Fri, 27 Oct 2017 16:49:13 +0200 Subject: [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). --- modules-available/dozmod/inc/pagemailtemplates.inc.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'modules-available/dozmod/inc/pagemailtemplates.inc.php') 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'); -- cgit v1.2.3-55-g7522