Example #1
0
 /**
  * missionRequests
  * CODE:mission_request_delete
  */
 public function executeDelete(sfWebRequest $request)
 {
     #security
     if (!$this->getUser()->hasCredential(array('Administrator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $request->checkCSRFProtection();
     $this->forward404Unless($mission_request = MissionRequestPeer::retrieveByPk($request->getParameter('id')), sprintf('Object mission_request does not exist (%s).', $request->getParameter('id')));
     $mission_request->delete();
     $this->redirect('missionRequest/index');
 }