Ejemplo n.º 1
0
 /**
  * Delete a user.
  */
 public function delete($userId)
 {
     $this->requireAdmin();
     $user = $this->userStore->getById($userId);
     if (empty($user)) {
         throw new NotFoundException(Lang::get('user_n_not_found', $userId));
     }
     $this->userService->deleteUser($user);
     header('Location: ' . PHPCI_URL . 'user');
     die;
 }
Ejemplo n.º 2
0
 /**
  * Delete a user.
  */
 public function delete($userId)
 {
     $this->requireAdmin();
     $user = $this->userStore->getById($userId);
     if (empty($user)) {
         throw new NotFoundException(Lang::get('user_n_not_found', $userId));
     }
     $this->userService->deleteUser($user);
     $response = new b8\Http\Response\RedirectResponse();
     $response->setHeader('Location', PHPCI_URL . 'user');
     return $response;
 }
Ejemplo n.º 3
0
 /**
  * Delete a user.
  */
 public function delete($userId)
 {
     if (!$_SESSION['user']->getIsAdmin()) {
         throw new ForbiddenException('You do not have permission to do that.');
     }
     $user = $this->userStore->getById($userId);
     if (empty($user)) {
         throw new NotFoundException('User with ID: ' . $userId . ' does not exist.');
     }
     $this->userService->deleteUser($user);
     header('Location: ' . PHPCI_URL . 'user');
     die;
 }