From 6e5c8f805481ed4af8a4f264e500fc977cb9e7d4 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 5 Apr 2015 19:21:15 +0000 Subject: [PATCH] add 'can_create' flag PFAHandler: - add $msg['can_create'] (true by default) DomainHandler: - set $msg['can_create'] based on is_superadmin list.tpl: - display 'create' button only if $msg['can_create'] is true Note: This is only an optical improvement, not a permission check. git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1769 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/DomainHandler.php | 1 + model/PFAHandler.php | 1 + templates/list.tpl | 2 ++ 3 files changed, 4 insertions(+) diff --git a/model/DomainHandler.php b/model/DomainHandler.php index b773de5b..39b2c4fe 100644 --- a/model/DomainHandler.php +++ b/model/DomainHandler.php @@ -122,6 +122,7 @@ class DomainHandler extends PFAHandler { $this->msg['store_error'] = 'pAdminEdit_domain_result_error'; $this->msg['successmessage'] = 'domain_updated'; } + $this->msg['can_create'] = $this->is_superadmin; } public function webformConfig() { diff --git a/model/PFAHandler.php b/model/PFAHandler.php index c1e82e88..04e9de21 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -112,6 +112,7 @@ abstract class PFAHandler { # (stored separately to make the functions reuseable) # filled by initMsg() protected $msg = array( + 'can_create' => True, 'confirm_delete' => 'confirm', ); diff --git a/templates/list.tpl b/templates/list.tpl index 073360cc..78ea225e 100644 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -106,8 +106,10 @@ +{if $msg.can_create}
{$PALANG.{$formconf.create_button}}

+{/if}
{$PALANG.download_csv}