1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-07-29 22:41:11 +03:00

MailboxHandler.php:

- rewrite and simplify delete()
- also cleanup fetchmail, quota	and quota2 tables

AliasHandler.php:
- update delete() to match the workflow in other classes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1562 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
Christian Boltz
2013-11-10 19:38:43 +00:00
parent bcb38c9664
commit 3b09562fb8
2 changed files with 36 additions and 90 deletions

View File

@ -355,15 +355,10 @@ class AliasHandler extends PFAHandler {
return $vacation_goto . '@' . Config::read('vacation_domain');
}
/**********************************************************************************************************************************************************
old function from non-PFAHandler times of AliasHandler
Will be replaced by a global delete() function in PFAHandler
**********************************************************************************************************************************************************/
/**
* @return true on success false on failure
*/
public function delete(){
public function delete() {
if( ! $this->view() ) {
$this->errormsg[] = 'An alias with that address does not exist.'; # TODO: make translatable
return false;
@ -374,14 +369,14 @@ class AliasHandler extends PFAHandler {
return false;
}
$result = db_delete('alias', 'address', $this->id);
if( $result == 1 ) {
list(/*NULL*/,$domain) = explode('@', $this->id);
db_log ($domain, 'delete_alias', $this->id);
return true;
}
db_delete('alias', 'address', $this->id);
list(/*NULL*/,$domain) = explode('@', $this->id);
db_log ($domain, 'delete_alias', $this->id);
$this->infomsg[] = Config::Lang_f('pDelete_delete_success', $this->id);
return true;
}
}
}
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */