Ejemplo n.º 1
0
 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));
         }
     }
 }
Ejemplo n.º 2
0
 public function DeleteUser($userId)
 {
     $this->userRepository->DeleteById($userId);
 }