From 5388bcf4cd99cb17065f6a74394ba92d53992423 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Mon, 4 Feb 2013 22:33:45 +0000 Subject: [PATCH] AliasHandler.php: - add MailboxAliasConfig() and $called_by_MailboxHandler for special handling if called by MailboxHandler - create_allowed(): always allow creating an alias for a mailbox - remove _missing_on_vacation() and _missing_active() which returned the default from $this->struct. This is now done by default, see previous change in PFAHandler git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1424 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/AliasHandler.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/model/AliasHandler.php b/model/AliasHandler.php index 049c21b3..8efd8dd8 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -9,6 +9,8 @@ class AliasHandler extends PFAHandler { protected $domain_field = 'domain'; + + protected $called_by_MailboxHandler = false; /** * @@ -101,6 +103,12 @@ class AliasHandler extends PFAHandler { ); } + /** + * set a special flag if called by MailboxHandler + */ + public function MailboxAliasConfig() { + $this->called_by_MailboxHandler = true; + } /** * AliasHandler needs some special handling in init() and therefore overloads the function. @@ -168,6 +176,8 @@ class AliasHandler extends PFAHandler { * check number of existing aliases for this domain - is one more allowed? */ private function create_allowed($domain) { + if ($this->called_by_MailboxHandler) return true; # always allow creating an alias for a mailbox + $limit = get_domain_properties ($domain); if ($limit['aliases'] == 0) return true; # unlimited @@ -311,9 +321,6 @@ class AliasHandler extends PFAHandler { } } - protected function _missing_on_vacation($field) { return $this->set_default_value($field); } - protected function _missing_active ($field) { return $this->set_default_value($field); } - /** * on $this->new, set localpart based on address */ @@ -325,7 +332,7 @@ class AliasHandler extends PFAHandler { } /** - * on $this->new, set localpart based on address + * on $this->new, set domain based on address */ protected function _missing_domain ($field) { if (isset($this->RAWvalues['address'])) {