Changeset View
Changeset View
Standalone View
Standalone View
src/app/Jobs/Group/DeleteJob.php
Show All 19 Lines | public function handle() | ||||
} | } | ||||
// sanity checks | // sanity checks | ||||
if ($group->isDeleted()) { | if ($group->isDeleted()) { | ||||
$this->fail(new \Exception("Group {$this->groupId} is already marked as deleted.")); | $this->fail(new \Exception("Group {$this->groupId} is already marked as deleted.")); | ||||
return; | return; | ||||
} | } | ||||
if ($group->isLdapReady()) { | |||||
\App\Backends\LDAP::deleteGroup($group); | \App\Backends\LDAP::deleteGroup($group); | ||||
$group->status |= \App\Group::STATUS_DELETED; | |||||
if ($group->isLdapReady()) { | |||||
$group->status ^= \App\Group::STATUS_LDAP_READY; | $group->status ^= \App\Group::STATUS_LDAP_READY; | ||||
} | } | ||||
/* | |||||
if (!\App\Backends\IMAP::deleteGroup($group)) { | |||||
throw new \Exception("Failed to delete group {$this->groupId} from IMAP."); | |||||
} | |||||
*/ | |||||
$group->status |= \App\Group::STATUS_DELETED; | |||||
$group->save(); | $group->save(); | ||||
} | } | ||||
} | } |