SF.net SVN: postfixadmin:[1534] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2013-10-13 15:26:43
|
Revision: 1534 http://sourceforge.net/p/postfixadmin/code/1534 Author: christian_boltz Date: 2013-10-13 15:26:37 +0000 (Sun, 13 Oct 2013) Log Message: ----------- model/*Handler.php and various other files - rename $this->return to $this->result Modified Paths: -------------- trunk/edit.php trunk/model/AliasHandler.php trunk/model/AliasdomainHandler.php trunk/model/MailboxHandler.php trunk/model/PFAHandler.php trunk/scripts/shells/alias.php trunk/scripts/shells/mailbox.php Modified: trunk/edit.php =================================================================== --- trunk/edit.php 2013-10-09 20:11:06 UTC (rev 1533) +++ trunk/edit.php 2013-10-13 15:26:37 UTC (rev 1534) @@ -81,7 +81,7 @@ header ("Location: " . $formconf['listview']); exit; } else { - $values = $handler->return; + $values = $handler->result; $values[$id_field] = $edit; } } Modified: trunk/model/AliasHandler.php =================================================================== --- trunk/model/AliasHandler.php 2013-10-09 20:11:06 UTC (rev 1533) +++ trunk/model/AliasHandler.php 2013-10-13 15:26:37 UTC (rev 1534) @@ -115,15 +115,15 @@ $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 @@ 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; } Modified: trunk/model/AliasdomainHandler.php =================================================================== --- trunk/model/AliasdomainHandler.php 2013-10-09 20:11:06 UTC (rev 1533) +++ trunk/model/AliasdomainHandler.php 2013-10-13 15:26:37 UTC (rev 1534) @@ -32,8 +32,8 @@ $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; Modified: trunk/model/MailboxHandler.php =================================================================== --- trunk/model/MailboxHandler.php 2013-10-09 20:11:06 UTC (rev 1533) +++ trunk/model/MailboxHandler.php 2013-10-13 15:26:37 UTC (rev 1534) @@ -55,7 +55,7 @@ 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); Modified: trunk/model/PFAHandler.php =================================================================== --- trunk/model/PFAHandler.php 2013-10-09 20:11:06 UTC (rev 1533) +++ trunk/model/PFAHandler.php 2013-10-13 15:26:37 UTC (rev 1534) @@ -493,13 +493,13 @@ * 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 @@ * @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 @@ * @return return value of previously called method */ public function result() { - return $this->return; + return $this->result; } Modified: trunk/scripts/shells/alias.php =================================================================== --- trunk/scripts/shells/alias.php 2013-10-09 20:11:06 UTC (rev 1533) +++ trunk/scripts/shells/alias.php 2013-10-13 15:26:37 UTC (rev 1534) @@ -174,7 +174,7 @@ 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"); Modified: trunk/scripts/shells/mailbox.php =================================================================== --- trunk/scripts/shells/mailbox.php 2013-10-09 20:11:06 UTC (rev 1533) +++ trunk/scripts/shells/mailbox.php 2013-10-13 15:26:37 UTC (rev 1534) @@ -306,7 +306,7 @@ } # 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+",'','','','','','','')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |