SF.net SVN: postfixadmin:[961] trunk/model/DomainHandler.php
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2011-02-13 23:35:55
|
Revision: 961 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=961&view=rev Author: christian_boltz Date: 2011-02-13 23:35:49 +0000 (Sun, 13 Feb 2011) Log Message: ----------- DomainHandler.php: - implement delete() Note that this is a dummy function at the moment. It doesn't work, it just errors out with "not implemented yet" ;-) Modified Paths: -------------- trunk/model/DomainHandler.php Modified: trunk/model/DomainHandler.php =================================================================== --- trunk/model/DomainHandler.php 2011-02-13 23:33:52 UTC (rev 960) +++ trunk/model/DomainHandler.php 2011-02-13 23:35:49 UTC (rev 961) @@ -77,6 +77,28 @@ $this->errormsg = $result['error']; return false; } + /** + * @return true on success false on failure + */ + public function delete(){ + if( ! $this->view() ) { + $this->errormsg[] = 'A domain with that name does not exist.'; # TODO: make translatable + return false; + } + + $this->errormsg[] = '*** Domain deletion not implemented yet ***'; + return false; # XXX function aborts here until TODO below is implemented! XXX + + # TODO: recursively delete mailboxes, aliases, alias_domains, fetchmail entries etc. before deleting the domain + # TODO: move the needed code from delete.php here + $result = db_delete('domain', 'domain', $this->username); + if( $result == 1 ) { + list(/*NULL*/,$domain) = explode('@', $this->username); + db_log ('CLI', $domain, 'delete_domain', $this->username); # TODO: replace hardcoded CLI # TODO delete_domain is not a valid db_log keyword yet because we don't yet log add/delete domain + return true; + } + } + } /* 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. |