Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1b09b84 authored by Ronak Patel's avatar Ronak Patel
Browse files

temp 3

parent f8692e9a
Loading
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -63,12 +63,13 @@ class BeforeUserDeletedListener implements IEventListener {

		$deleteShopAccount = $this->shopAccountService->getShopDeletePreference($uid);
		$shopUser = $this->shopAccountService->getUser($email);

		if ($shopUser && $this->shopAccountService->isUserOIDC($shopUser)) {
			if ($deleteShopAccount) {
				$subscriptions = $this->shopAccountService->getSubscriptions($shopUser['id'], self::PENDING_CANCEL_STATUS);
				foreach ($subscriptions as $subscription) {
					$this->shopAccountService->updateSubscriptionStatus($subscription['id'], self::CANCELLED_STATUS);
				}
		if ($shopUser && $this->shopAccountService->isUserOIDC($shopUser)) {
			if ($deleteShopAccount) {
				$this->shopAccountService->deleteUser($shopUser['id']);
			} else {
				$newEmail = $this->shopAccountService->getShopEmailPostDeletePreference($uid);