1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

Prevent certificate deletion for main domain

This commit is contained in:
Matej Bačo 2022-03-30 13:31:46 +00:00
parent 5897a70536
commit 933f3372fe

View file

@ -536,6 +536,13 @@ class DeletesV1 extends Worker
new Query('certificateId', Query::TYPE_EQUAL, [$document['certificateId']])
]);
if(!$domainUsingCertificate) {
$mainDomain = App::getEnv('_APP_DOMAIN_TARGET', '');
if($mainDomain === $document->getAttribute('domain')) {
$domainUsingCertificate = $mainDomain;
}
}
// If certificate is still used by some domain, mark we can't delete.
// Current domain should not be found, because we only have copy. Original domain is already deleted from database.
if($domainUsingCertificate) {