当前位置: 首页>>代码示例>>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;未经允许,请勿转载。