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

Commit 86e66b26 authored by Ronak Patel's avatar Ronak Patel
Browse files

reverts

parent 99c5b433
Loading
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -41,8 +41,6 @@ class BeforeUserDeletedListener implements IEventListener {
		$email = $user->getEMailAddress();
		$uid = $user->getUID();
		$isUserOnLDAP = $this->LDAPConnectionService->isUserOnLDAPBackend($user);
		$shopUser = $this->shopAccountService->getUser($email);
		$this->shopAccountService->updateSubscriptionStatus(71981, self::CANCELLED_STATUS);

		$this->logger->info("PostDelete user {user}", array('user' => $uid));
		$this->userService->ecloudDelete(
@@ -64,10 +62,14 @@ 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);
				}
				$this->shopAccountService->deleteUser($shopUser['id']);
			} else {
				$newEmail = $this->shopAccountService->getShopEmailPostDeletePreference($uid);