From 37b29231e47a0c4458dc1c15d98588f16f07e1e2 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 06 Aug 2015 03:18:44 -0400
Subject: [PATCH] - don't set password via remoting if field is empty

---
 interface/web/mail/mail_domain_del.php |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/interface/web/mail/mail_domain_del.php b/interface/web/mail/mail_domain_del.php
index ba715a6..6941cd6 100644
--- a/interface/web/mail/mail_domain_del.php
+++ b/interface/web/mail/mail_domain_del.php
@@ -60,31 +60,31 @@
 		// 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')");
+		$records = $app->db->queryAllRecords("SELECT forwarding_id as id FROM mail_forwarding WHERE source like ? OR (destination like ? AND type != 'forward')", '%@' . $domain, '%@' . $domain);
 		foreach($records as $rec) {
 			$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)."'");
+		$records = $app->db->queryAllRecords("SELECT mailget_id as id FROM mail_get WHERE destination like ?", '%@' . $domain);
 		foreach($records as $rec) {
 			$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)."'");
+		$records = $app->db->queryAllRecords("SELECT mailuser_id as id FROM mail_user WHERE email like ?", '%@' . $domain);
 		foreach($records as $rec) {
 			$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)."'");
+		$records = $app->db->queryAllRecords("SELECT id FROM spamfilter_users WHERE email = ?", '%@' . $domain);
 		foreach($records as $rec) {
 			$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)."'");
+		$records = $app->db->queryAllRecords("SELECT mailinglist_id FROM mail_mailinglist WHERE domain = ?", $domain);
 		foreach($records as $rec) {
 			$app->db->datalogDelete('mail_mailinglist', 'mailinglist_id', $rec['id']);
 		}

--
Gitblit v1.9.1