diff options
Diffstat (limited to 'modules-available/dozmod/inc/pagemailtemplates.inc.php')
-rw-r--r-- | modules-available/dozmod/inc/pagemailtemplates.inc.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/modules-available/dozmod/inc/pagemailtemplates.inc.php b/modules-available/dozmod/inc/pagemailtemplates.inc.php index 90734a50..ff47977f 100644 --- a/modules-available/dozmod/inc/pagemailtemplates.inc.php +++ b/modules-available/dozmod/inc/pagemailtemplates.inc.php @@ -15,16 +15,10 @@ class Page_mail_templates extends Page } elseif ($action === 'save') { if (User::hasPermission("templates.save")) { $this->handleSave(); - } else { - Message::addError('main.no-permission'); - Util::redirect('?do=dozmod§ion=templates'); } } elseif ($action === 'reset') { 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); @@ -65,12 +59,16 @@ class Page_mail_templates extends Page $t['modified'] = !$t['original']; $t['conflict'] = !$t['original'] && $t['edit_version'] < $t['version']; } - } + protected function doRender() { $this->enrichHtml(); - Render::addTemplate('templates', ['templates' => $this->templates]); + Render::addTemplate('templates', [ + 'templates' => $this->templates, + 'allowedReset' => User::hasPermission("templates.reset"), + 'allowedSave' => User::hasPermission("templates.save"), + ]); } private function forcmp($string) |