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
pull/2/head
Christian Boltz 10 years ago
parent 3f451371e3
commit 6e5c8f8054

@ -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() {

@ -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',
);

@ -106,8 +106,10 @@
</table>
{if $msg.can_create}
<br /><a href="edit.php?table={$table|escape:"url"}" class="button">{$PALANG.{$formconf.create_button}}</a><br />
<br />
{/if}
<br /><a href="list.php?table={$table|escape:"url"}&amp;output=csv">{$PALANG.download_csv}</a>
</div>

Loading…
Cancel
Save