本文整理汇总了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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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();
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}