From a4431e25d3bde52f2d8f2deb1b95a359bf3c1475 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Tue, 10 Mar 2020 07:36:22 +0100 Subject: [PATCH] remove ssl-certificates connected to domains that are being deleted when deleting a customer; fixes #818 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/Customers.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index 8bb2616c..47e309f4 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -1410,7 +1410,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource 'id' => $id ), true, true); - // first gather all domain-id's to clean up panel_domaintoip and dns-entries accordingly + // first gather all domain-id's to clean up panel_domaintoip, dns-entries and certificates accordingly $did_stmt = Database::prepare("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id"); Database::pexecute($did_stmt, array( 'id' => $id @@ -1426,6 +1426,11 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource Database::pexecute($stmt, array( 'did' => $row['id'] ), true, true); + // remove domain->certificates entries + $stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :did"); + Database::pexecute($stmt, array( + 'did' => $row['id'] + ), true, true); } // remove customer domains $stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");