From 7fe908c50c8dbc5cc05f571dbe11d66141caacd4 Mon Sep 17 00:00:00 2001 From: Marius Cramer <m.cramer@pixcept.de> Date: Thu, 14 Nov 2013 09:01:22 -0500 Subject: [PATCH] Cleaning up code to match coding guidelines --- interface/web/mail/mail_domain_del.php | 33 +++++++++++++++++---------------- 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/interface/web/mail/mail_domain_del.php b/interface/web/mail/mail_domain_del.php index 806996a..ba715a6 100644 --- a/interface/web/mail/mail_domain_del.php +++ b/interface/web/mail/mail_domain_del.php @@ -39,8 +39,8 @@ * End Form configuration ******************************************/ -require_once('../../lib/config.inc.php'); -require_once('../../lib/app.inc.php'); +require_once '../../lib/config.inc.php'; +require_once '../../lib/app.inc.php'; //* Check permissions for module $app->auth->check_module_permissions('mail'); @@ -53,46 +53,47 @@ function onBeforeDelete() { global $app; $conf; - + $domain = $this->dataRecord['domain']; - + // Before we delete the email domain, // we will delete all depending records. - + // Delete all forwardings where the source or destination belongs to this domain $records = $app->db->queryAllRecords("SELECT forwarding_id as id FROM mail_forwarding WHERE source like '%@".$app->db->quote($domain)."' OR (destination like '%@".$app->db->quote($domain)."' AND type != 'forward')"); foreach($records as $rec) { - $app->db->datalogDelete('mail_forwarding','forwarding_id',$rec['id']); + $app->db->datalogDelete('mail_forwarding', 'forwarding_id', $rec['id']); } - + // Delete all fetchmail accounts where destination belongs to this domain $records = $app->db->queryAllRecords("SELECT mailget_id as id FROM mail_get WHERE destination like '%@".$app->db->quote($domain)."'"); foreach($records as $rec) { - $app->db->datalogDelete('mail_get','mailget_id',$rec['id']); + $app->db->datalogDelete('mail_get', 'mailget_id', $rec['id']); } - + // Delete all mailboxes where destination belongs to this domain $records = $app->db->queryAllRecords("SELECT mailuser_id as id FROM mail_user WHERE email like '%@".$app->db->quote($domain)."'"); foreach($records as $rec) { - $app->db->datalogDelete('mail_user','mailuser_id',$rec['id']); + $app->db->datalogDelete('mail_user', 'mailuser_id', $rec['id']); } - + // Delete all spamfilters that belong to this domain $records = $app->db->queryAllRecords("SELECT id FROM spamfilter_users WHERE email = '%@".$app->db->quote($domain)."'"); foreach($records as $rec) { - $app->db->datalogDelete('spamfilter_users','id',$rec['id']); + $app->db->datalogDelete('spamfilter_users', 'id', $rec['id']); } - + // Delete all mailinglists that belong to this domain $records = $app->db->queryAllRecords("SELECT mailinglist_id FROM mail_mailinglist WHERE domain = '".$app->db->quote($domain)."'"); foreach($records as $rec) { - $app->db->datalogDelete('mail_mailinglist','mailinglist_id',$rec['id']); + $app->db->datalogDelete('mail_mailinglist', 'mailinglist_id', $rec['id']); } - + } + } $page = new page_action; $page->onDelete(); -?> \ No newline at end of file +?> -- Gitblit v1.9.1