remove ssl-certificates connected to domains that are being deleted when deleting a customer; fixes #818
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -1410,7 +1410,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
'id' => $id
|
'id' => $id
|
||||||
), true, true);
|
), 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");
|
$did_stmt = Database::prepare("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
|
||||||
Database::pexecute($did_stmt, array(
|
Database::pexecute($did_stmt, array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
@@ -1426,6 +1426,11 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
Database::pexecute($stmt, array(
|
Database::pexecute($stmt, array(
|
||||||
'did' => $row['id']
|
'did' => $row['id']
|
||||||
), true, true);
|
), 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
|
// remove customer domains
|
||||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
|
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
|
||||||
|
|||||||
Reference in New Issue
Block a user