From bb7a3ff04d6f942963d2403bbd32f2a76bd9fff5 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 13 Oct 2013 15:26:37 +0000 Subject: [PATCH] model/*Handler.php and various other files - rename $this->return to $this->result git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1534 a1433add-5e2c-0410-b055-b7f2511e0802 --- edit.php | 2 +- model/AliasHandler.php | 10 +++++----- model/AliasdomainHandler.php | 4 ++-- model/MailboxHandler.php | 2 +- model/PFAHandler.php | 10 +++++----- scripts/shells/alias.php | 2 +- scripts/shells/mailbox.php | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/edit.php b/edit.php index 24a9d0d9..b00cc1c5 100644 --- a/edit.php +++ b/edit.php @@ -81,7 +81,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET" && $active == '') { header ("Location: " . $formconf['listview']); exit; } else { - $values = $handler->return; + $values = $handler->result; $values[$id_field] = $edit; } } diff --git a/model/AliasHandler.php b/model/AliasHandler.php index 73cc2944..d2be4c4e 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -115,15 +115,15 @@ class AliasHandler extends PFAHandler { $retval = parent::init($id); # hide 'goto_mailbox' for non-mailbox aliases - # parent::init called view() before, so we can rely on having $this->return filled - # (only validate_new_id() is called from parent::init and could in theory change $this->return) - if ($this->new || $this->return['is_mailbox'] == 0) { + # parent::init called view() before, so we can rely on having $this->result filled + # (only validate_new_id() is called from parent::init and could in theory change $this->result) + if ($this->new || $this->result['is_mailbox'] == 0) { $this->struct['goto_mailbox']['editable'] = 0; $this->struct['goto_mailbox']['display_in_form'] = 0; $this->struct['goto_mailbox']['display_in_list'] = 0; } - if ( !$this->new && $this->return['is_mailbox'] && $this->admin_username != ''&& !authentication_has_role('global-admin') ) { + if ( !$this->new && $this->result['is_mailbox'] && $this->admin_username != ''&& !authentication_has_role('global-admin') ) { # domain admins are not allowed to change mailbox alias $CONF['alias_control_admin'] = NO # TODO: apply the same restriction to superadmins? if (!Config::bool('alias_control_admin')) { @@ -369,7 +369,7 @@ class AliasHandler extends PFAHandler { return false; } - if ($this->return['is_mailbox']) { + if ($this->result['is_mailbox']) { $this->errormsg[] = 'This alias belongs to a mailbox and can\'t be deleted.'; # TODO: make translatable return false; } diff --git a/model/AliasdomainHandler.php b/model/AliasdomainHandler.php index 180dc106..02c12ff5 100644 --- a/model/AliasdomainHandler.php +++ b/model/AliasdomainHandler.php @@ -32,8 +32,8 @@ class AliasdomainHandler extends PFAHandler { $used_targets = array(); foreach ($this->allowed_domains as $dom) { - if (isset($this->return[$dom]) ) { # already used as alias_domain - $used_targets[$this->return[$dom]['target_domain']] = $this->return[$dom]['target_domain']; + if (isset($this->result[$dom]) ) { # already used as alias_domain + $used_targets[$this->result[$dom]['target_domain']] = $this->result[$dom]['target_domain']; } else { # might be available $this->struct['alias_domain']['options'][$dom] = $dom; $this->struct['target_domain']['options'][$dom] = $dom; diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index 90b4519b..13dd9496 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -55,7 +55,7 @@ class MailboxHandler extends PFAHandler { if ($this->new) { $currentquota = 0; } else { - $currentquota = $this->return['quotabytes']; # parent::init called ->view() + $currentquota = $this->result['quotabytes']; # parent::init called ->view() } $this->updateMaxquota($domain, $currentquota); diff --git a/model/PFAHandler.php b/model/PFAHandler.php index 0efd91be..dda3f587 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -493,13 +493,13 @@ abstract class PFAHandler { * get the values of an item * @param boolean (optional) - if false, $this->errormsg[] will not be filled in case of errors * @return bool - true if item was found - * The data is stored in $this->return (as associative array of column => value) + * The data is stored in $this->result (as associative array of column => value) * error messages (if any) are stored in $this->errormsg */ public function view($errors=true) { $result = $this->read_from_db(array($this->id_field => $this->id) ); if (count($result) == 1) { - $this->return = $result[$this->id]; + $this->result = $result[$this->id]; return true; } @@ -514,12 +514,12 @@ abstract class PFAHandler { * @param integer limit - maximum number of rows to return * @param integer offset - number of first row to return * @return bool - true if at least one item was found - * The data is stored in $this->return (as array of rows, each row is an associative array of column => value) + * The data is stored in $this->result (as array of rows, each row is an associative array of column => value) */ public function getList($condition, $limit=-1, $offset=-1) { $result = $this->read_from_db($condition, $limit, $offset); if (count($result) >= 1) { - $this->return = $result; + $this->result = $result; return true; } @@ -570,7 +570,7 @@ abstract class PFAHandler { * @return return value of previously called method */ public function result() { - return $this->return; + return $this->result; } diff --git a/scripts/shells/alias.php b/scripts/shells/alias.php index 6f0d9955..6388b2a2 100644 --- a/scripts/shells/alias.php +++ b/scripts/shells/alias.php @@ -174,7 +174,7 @@ class ViewTask extends Shell { if ( ! $handler->view() ) { $this->error("Error: Not Found", "The requested alias was not found!"); } else { - $result = $handler->return; + $result = $handler->result; $this->out(sprintf("Entries for: %s\n", $address)); $this->out("Goto: \t"); diff --git a/scripts/shells/mailbox.php b/scripts/shells/mailbox.php index 7d1ef988..76c97573 100644 --- a/scripts/shells/mailbox.php +++ b/scripts/shells/mailbox.php @@ -306,7 +306,7 @@ class ViewTask extends Shell { } # TODO: offer alternative output formats (based on parameter) # TODO: whitespace fix - 8 lines below - $result = $handler->return; + $result = $handler->result; $this->out(sprintf("Entries for: %s\n", $address)); $this->out(""); $this->out(sprintf("+%'-25s+%'-15s+%'-10s+%'-20s+%'-8s+%'-8s+%'-6s+",'','','','','','',''));