Changeset View
Changeset View
Standalone View
Standalone View
src/app/Observers/EntitlementObserver.php
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | public function creating(Entitlement $entitlement) | ||||
} | } | ||||
$result = $sku->handler_class::preReq($entitlement, $wallet->owner); | $result = $sku->handler_class::preReq($entitlement, $wallet->owner); | ||||
if (!$result) { | if (!$result) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
/** | |||||
* Handle the entitlement "deleted" event. | |||||
* | |||||
* @param \App\Entitlement $entitlement The entitlement. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function deleted(Entitlement $entitlement) | |||||
{ | |||||
// Remove all configured 2FA methods from Roundcube database | |||||
if ($entitlement->sku->title == '2fa') { | |||||
// FIXME: Should that be an async job? | |||||
$sf = new \App\Auth\SecondFactor($entitlement->entitleable); | |||||
$sf->removeFactors(); | |||||
} | |||||
} | |||||
} | } |