SF.net SVN: postfixadmin:[912] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2010-12-26 00:20:18
|
Revision: 912 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=912&view=rev Author: christian_boltz Date: 2010-12-26 00:20:12 +0000 (Sun, 26 Dec 2010) Log Message: ----------- model/AliasHandler.php: changed behaviour of get() - get() now returns only true (success) / false (failure) instead of the alias list (result of partly merging in scripts/models-ext/AliasHandler.php) - new method result() to get the real result (alias targets) - added TODO on if(sizeof($addresses) == 0) - this should never happen model/VacationHandler.php: - updated for new AliasHandler bevaviour xmlrpc.php: - updated for new AliasHandler bevaviour - switched from obsolete change_pass to change_pw method Modified Paths: -------------- trunk/model/AliasHandler.php trunk/model/VacationHandler.php trunk/xmlrpc.php Modified: trunk/model/AliasHandler.php =================================================================== --- trunk/model/AliasHandler.php 2010-12-26 00:00:24 UTC (rev 911) +++ trunk/model/AliasHandler.php 2010-12-26 00:20:12 UTC (rev 912) @@ -45,9 +45,10 @@ } } $list = $new_list; - return $list; + $this->return = $list; + return true; } - return array(); + return false; } /** @@ -141,7 +142,8 @@ $goto = escape_string(implode(',', $addresses)); $table_alias = table_by_key('alias'); if(sizeof($addresses) == 0) { - $sql = "DELETE FROM $table_alias WHERE address = '$username'"; + $sql = "DELETE FROM $table_alias WHERE address = '$username'"; # TODO: should never happen + error_log("Alias set to empty / deleted: $username"); # TODO: more/better error handling - maybe just return false? } if($this->hasAliasRecord() == false) { $true = db_get_boolean(True); @@ -184,4 +186,13 @@ } return false; } -} + + /** + * @return return value of previously called method + */ + public function result() { + return $this->return; + } + } + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ Modified: trunk/model/VacationHandler.php =================================================================== --- trunk/model/VacationHandler.php 2010-12-26 00:00:24 UTC (rev 911) +++ trunk/model/VacationHandler.php 2010-12-26 00:20:12 UTC (rev 912) @@ -13,7 +13,8 @@ */ function remove() { $ah = new AliasHandler($this->username); - $aliases = $ah->get(true); // fetch all. + $result = $ah->get(true); // fetch all # TODO check $result, error handling + $aliases = $ah->result; $new_aliases = array(); $table_vacation = table_by_key('vacation'); $table_vacation_notification = table_by_key('vacation_notification'); @@ -130,3 +131,4 @@ return $vacation_goto; } } +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ Modified: trunk/xmlrpc.php =================================================================== --- trunk/xmlrpc.php 2010-12-26 00:00:24 UTC (rev 911) +++ trunk/xmlrpc.php 2010-12-26 00:20:12 UTC (rev 912) @@ -74,7 +74,7 @@ */ public function changePassword($old_password, $new_password) { $uh = new UserHandler($_SESSION['username']); - return $uh->change_pass($old_password, $new_password); + return $uh->change_pw($new_password, $old_password); } /** @@ -141,7 +141,8 @@ public function get() { $ah = new AliasHandler($_SESSION['username']); /* I see no point in returning special addresses to the user. */ - return $ah->get(false); + $ah->get(false); + return $ah->result; } /** @@ -167,3 +168,4 @@ return $ah->hasStoreAndForward(); } } +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |