From 1d9651b18ac5345add9c326657fa21d1771414ef Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Thu, 4 Mar 2021 12:07:20 +0100 Subject: [PATCH] trgger acme.sh removal for domains if customers is being deleted; fixes #923 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/Customers.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index 6352c6a4..c262bf45 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -1491,7 +1491,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource ), true, true); // 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"); + $did_stmt = Database::prepare("SELECT `id`, `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id"); Database::pexecute($did_stmt, array( 'id' => $id ), true, true); @@ -1511,6 +1511,8 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource Database::pexecute($stmt, array( 'did' => $row['id'] ), true, true); + // remove domain from acme.sh / lets encrypt if used + \Froxlor\System\Cronjob::inserttask('12', $row['domain']); } // remove customer domains $stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");