Changeset View
Changeset View
Standalone View
Standalone View
src/app/Jobs/Domain/DeleteJob.php
Show All 19 Lines | public function handle() | ||||
} | } | ||||
// sanity checks | // sanity checks | ||||
if ($domain->isDeleted()) { | if ($domain->isDeleted()) { | ||||
$this->fail(new \Exception("Domain {$this->domainId} is already marked as deleted.")); | $this->fail(new \Exception("Domain {$this->domainId} is already marked as deleted.")); | ||||
return; | return; | ||||
} | } | ||||
if (\config('app.with_ldap') && $domain->isLdapReady()) { | |||||
\App\Backends\LDAP::deleteDomain($domain); | \App\Backends\LDAP::deleteDomain($domain); | ||||
$domain->status |= \App\Domain::STATUS_DELETED; | |||||
if ($domain->isLdapReady()) { | |||||
$domain->status ^= \App\Domain::STATUS_LDAP_READY; | $domain->status ^= \App\Domain::STATUS_LDAP_READY; | ||||
} | } | ||||
$domain->status |= \App\Domain::STATUS_DELETED; | |||||
$domain->save(); | $domain->save(); | ||||
} | } | ||||
} | } |