예제 #1
0
 public function deleteAction()
 {
     $user = $this->_getUser();
     $this->_helper->allowed('delete', $user);
     $this->_userSrv->delete($user);
     $this->getResponse()->setHttpResponseCode(204);
     $this->_helper->viewRenderer->setNoRender(TRUE);
 }
예제 #2
0
 /**
  * Deletes the given user
  */
 public function deleteAction()
 {
     // Try to load the chosen user
     $userId = $this->getRequest()->getParam('id');
     $user = $this->_userSrv->load($userId);
     if (empty($user)) {
         throw new NotFoundException('User ' . $userId . ' not found', 404);
     }
     // Check permissions
     $this->_helper->allowed('delete', $user);
     // Remove the user
     $this->_userSrv->delete($userId);
     $this->view->data = true;
 }