示例#1
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->userStore->delete($user);
     header('Location: ' . PHPCI_URL . 'user');
     die;
 }
示例#2
0
 public function deleteUser(User $user)
 {
     return $this->store->delete($user);
 }