當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sfWebRequest::checkCSRFProtection方法代碼示例

本文整理匯總了PHP中sfWebRequest::checkCSRFProtection方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfWebRequest::checkCSRFProtection方法的具體用法?PHP sfWebRequest::checkCSRFProtection怎麽用?PHP sfWebRequest::checkCSRFProtection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sfWebRequest的用法示例。


在下文中一共展示了sfWebRequest::checkCSRFProtection方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($team = Doctrine::getTable('Team')->find(array($request->getParameter('id'))), sprintf('Object team does not exist (%s).', array($request->getParameter('id'))));
     $team->delete();
     $this->redirect('@team');
 }
開發者ID:nubee,項目名稱:nubee,代碼行數:7,代碼來源:actions.class.php

示例2: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($JobeetJob = JobeetJobPeer::retrieveByPk($request->getParameter('id')), sprintf('Object JobeetJob does not exist (%s).', $request->getParameter('id')));
     $JobeetJob->delete();
     $this->redirect('job/index');
 }
開發者ID:hira-yahoo,項目名稱:Jobeet-Skeleton,代碼行數:7,代碼來源:actions.class.php

示例3: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($encuestado_sanciones = Doctrine::getTable('EncuestadoSanciones')->find(array($request->getParameter('id'))), sprintf('Object encuestado_sanciones does not exist (%s).', $request->getParameter('id')));
     $encuestado_sanciones->delete();
     $this->redirect('EncuestadoSancionesVigentes/index');
 }
開發者ID:rmoralesm,項目名稱:FONDEF-D08I1205,代碼行數:7,代碼來源:actions.class.php

示例4: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($Device = DevicePeer::retrieveByPk($request->getParameter('id')), sprintf('Object Device does not exist (%s).', $request->getParameter('id')));
     $Device->delete();
     $this->redirect('device/index');
 }
開發者ID:navid045,項目名稱:maxlaptop,代碼行數:7,代碼來源:actions.class.php

示例5: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($student_center = Doctrine_Core::getTable('StudentCenter')->find(array($request->getParameter('id'))), sprintf('Object student_center does not exist (%s).', $request->getParameter('id')));
     $student_center->delete();
     $this->redirect('studentcenter/index');
 }
開發者ID:eyumay,項目名稱:srms.psco,代碼行數:7,代碼來源:actions.class.php

示例6: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($sfGuardUser = sfGuardUserPeer::retrieveByPk($request->getParameter('id')), sprintf('Object sfGuardUser does not exist (%s).', $request->getParameter('id')));
     $sfGuardUser->delete();
     $this->redirect('sfguarduser/index');
 }
開發者ID:soltis,項目名稱:Mieszalnia,代碼行數:7,代碼來源:actions.class.php

示例7: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($user = Doctrine_Core::getTable('User')->find(array($request->getParameter('user_id'))), sprintf('Object user does not exist (%s).', $request->getParameter('user_id')));
     $user->delete();
     $this->redirect('my_ruckus/index');
 }
開發者ID:rohitbatra1987,項目名稱:ruckus_dev,代碼行數:7,代碼來源:actions.class.php

示例8: executeInvite

 /**
  * Executes invite action
  *
  * @param sfWebRequest $request
  */
 public function executeInvite(sfWebRequest $request)
 {
     if ($request->isMethod(sfWebRequest::POST)) {
         $request->checkCSRFProtection();
         if ($request->hasParameter('invite')) {
             $result = $this->processInvite($request);
             $callback = '@application_render?id=' . $this->application->getId();
             if ($request->hasParameter('callback')) {
                 $callback .= '&url=' . urlencode($request->getParameter('callback'));
             }
             $this->redirect($callback);
         }
     }
     $fromMember = $this->getUser()->getMember();
     $this->nowpage = (int) $request->getParameter('nowpage', 1);
     if ($request->hasParameter('previous')) {
         $this->nowpage--;
     } else {
         if ($request->hasParameter('next')) {
             $this->nowpage++;
         }
     }
     $this->ids = $request->getParameter('ids', array());
     $this->forward404Unless($this->application->isHadByMember($fromMember->getId()));
     $this->pager = Doctrine::getTable('MemberRelationship')->getFriendListPager($fromMember->getId(), $this->nowpage, 15);
     $this->installedFriends = Doctrine::getTable('MemberApplication')->getInstalledFriendIds($this->application, $fromMember);
     $this->form = new BaseForm();
 }
開發者ID:niryuu,項目名稱:opOpenSocialPlugin,代碼行數:33,代碼來源:actions.class.php

示例9: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($scss_course = Doctrine_Core::getTable('ScssCourse')->find(array($request->getParameter('id'))), sprintf('Object scss_course does not exist (%s).', $request->getParameter('id')));
     $scss_course->delete();
     $this->redirect('course/index');
 }
開發者ID:ner0tic,項目名稱:scss,代碼行數:7,代碼來源:actions.class.php

示例10: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->album->delete();
     $this->getUser()->setFlash('notice', 'The album was deleted successfully.');
     $this->redirect('album/list');
 }
開發者ID:kawahara,項目名稱:opAlbumPlugin,代碼行數:7,代碼來源:actions.class.php

示例11: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->dispatcher->notify(new sfEvent($this, 'admin.delete_object', array('object' => $this->getRoute()->getObject())));
     //On récupère l'image source
     $imgSource = $this->getRoute()->getObject()->getFichierSource();
     //Ainsi que le dossier qui la contient
     $uploadFolder = sfConfig::get('app_images_upload_dir');
     //On en déduit son nom est son extension
     $filename = substr($imgSource, 0, strrpos($imgSource, '.'));
     $extension = substr(strrchr($imgSource, '.'), 1);
     //On supprime l'image de base
     unlink($uploadFolder . $imgSource);
     //Puis pour chacune des tailles prédefinies à laquelle l'image a pu être redimensionnée
     foreach (convertImageToThumb::$predefinedSizes as $suffix => $infos) {
         //On supprime aussi le bon fichier
         unlink($uploadFolder . $filename . "_" . $suffix . "." . $extension);
     }
     $this->getRoute()->getObject()->delete();
     //$this->getUser()->setFlash('notice', 'The item was deleted successfully.');
     $this->json['success'] = true;
     $this->setRequestParameter('json', $this->json);
     $this->forward($this->getModuleName(), 'jsonResponse');
     //$this->redirect('@illustration');
 }
開發者ID:njch,項目名稱:PatBati,代碼行數:25,代碼來源:actions.class.php

示例12: executeBatch

 public function executeBatch(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     if (!($ids = $request->getParameter('ids'))) {
         $this->getUser()->setFlash('error', 'You must at least select one item.');
         $this->redirect('@student_form_fields');
     }
     if (!($action = $request->getParameter('batch_action'))) {
         $this->getUser()->setFlash('error', 'You must select an action to execute on the selected items.');
         $this->redirect('@student_form_fields');
     }
     if (!method_exists($this, $method = 'execute' . ucfirst($action))) {
         throw new InvalidArgumentException(sprintf('You must create a "%s" method for action "%s"', $method, $action));
     }
     if (!$this->getUser()->hasCredential($this->configuration->getCredentials($action))) {
         $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
     }
     $validator = new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'student_form_fields'));
     try {
         // validate ids
         $ids = $validator->clean($ids);
         // execute batch
         $this->{$method}($request);
     } catch (sfValidatorError $e) {
         $this->getUser()->setFlash('error', 'A problem occurs when deleting the selected items as some items do not exist anymore.');
     }
     $this->redirect('@student_form_fields');
 }
開發者ID:nurtai,項目名稱:collegERP,代碼行數:28,代碼來源:actions.class.php

示例13: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($energyaction = EnergyactionPeer::retrieveByPk($request->getParameter('id')), sprintf('Object energyaction does not exist (%s).', $request->getParameter('id')));
     $energyaction->delete();
     $this->redirect('energyaction/index');
 }
開發者ID:jfesquet,項目名稱:tempos,代碼行數:7,代碼來源:actions.class.php

示例14: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($activity = ActivityPeer::retrieveByPk($request->getParameter('id')), sprintf('Object activity does not exist (%s).', $request->getParameter('id')));
     $activity->delete();
     $this->redirect('activity/index');
 }
開發者ID:jfesquet,項目名稱:tempos,代碼行數:7,代碼來源:actions.class.php

示例15: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->getRoute()->getObject()->delete();
     $this->getUser()->setFlash('notice', 'The item was deleted successfully.');
     $this->redirect('@issues');
 }
開發者ID:jackbravo,項目名稱:amaranto,代碼行數:7,代碼來源:actions.class.php


注:本文中的sfWebRequest::checkCSRFProtection方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。