From 0f0b7d336c114d8aa3f2a90d9647d6cf3944756c Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 27 Nov 2011 21:29:00 +0000 Subject: [PATCH] PFAHandler: - split code to handle domain_field == "" && admin_username != "" from __construct() to no_domain_field(). Default behaviour stays to die(), but AdminHandler will override it git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1286 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/PFAHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/model/PFAHandler.php b/model/PFAHandler.php index 4c1fbe81..b2f0053a 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -29,7 +29,7 @@ class PFAHandler { $this->admin_username = $admin_username; if ($this->domain_field == "") { - if ($admin_username != "") die('Attemp to restrict domains without setting $this->domain_field!'); + $this->no_domain_field(); } else { if ($admin_username != "") { $this->allowed_domains = list_domains_for_admin($admin_username); @@ -42,6 +42,10 @@ class PFAHandler { $this->initMsg(); } + protected function no_domain_field() { + if ($this->admin_username != "") die('Attemp to restrict domains without setting $this->domain_field!'); + } + /** * initialize with $id and check if it is valid * @param string $id