public function DeleteUser($userId) { $user = $this->userRepository->LoadById($userId); $this->userRepository->DeleteById($userId); if (Configuration::Instance()->GetKey(ConfigKeys::REGISTRATION_NOTIFY, new BooleanConverter())) { $currentUser = ServiceLocator::GetServer()->GetUserSession(); $applicationAdmins = $this->userViewRepository->GetApplicationAdmins(); $groupAdmins = $this->userViewRepository->GetGroupAdmins($userId); foreach ($applicationAdmins as $applicationAdmin) { ServiceLocator::GetEmailService()->Send(new AccountDeletedEmail($user, $applicationAdmin, $currentUser)); } foreach ($groupAdmins as $groupAdmin) { ServiceLocator::GetEmailService()->Send(new AccountDeletedEmail($user, $groupAdmin, $currentUser)); } } }
public function DeleteUser($userId) { $this->userRepository->DeleteById($userId); }