Changeset View
Changeset View
Standalone View
Standalone View
src/app/Jobs/Domain/DeleteJob.php
Show All 12 Lines | class DeleteJob extends DomainJob | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$domain = $this->getDomain(); | $domain = $this->getDomain(); | ||||
// 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; | |||||
} | } | ||||
\App\Backends\LDAP::deleteDomain($domain); | \App\Backends\LDAP::deleteDomain($domain); | ||||
$domain->status |= \App\Domain::STATUS_DELETED; | $domain->status |= \App\Domain::STATUS_DELETED; | ||||
$domain->save(); | $domain->save(); | ||||
} | } | ||||
} | } |