当前位置: 首页>>代码示例>>PHP>>正文


PHP CSRF::getToken方法代码示例

本文整理汇总了PHP中CSRF::getToken方法的典型用法代码示例。如果您正苦于以下问题:PHP CSRF::getToken方法的具体用法?PHP CSRF::getToken怎么用?PHP CSRF::getToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSRF的用法示例。


在下文中一共展示了CSRF::getToken方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeShow

 public function executeShow(sfWebRequest $request)
 {
     $this->forward404Unless($this->inbox = Doctrine::getTable('Inbox')->find(array($request->getParameter('id'))), sprintf('Object inbox does not exist (%s).', $request->getParameter('id')));
     $this->comments = Comment::getFor($this->inbox);
     $this->form = new CommentInboxForm();
     $this->form->setCommented($this->inbox);
     $this->form->setDefault('noVote', 1);
     $this->inboxed = Doctrine_Query::create()->select()->from('sfGuardUserProfile p')->leftJoin('p.Inboxed i')->where('i.inbox_id = ?', $this->inbox->getId())->execute();
     $this->csrf = CSRF::getToken();
 }
开发者ID:limitium,项目名称:uberlov,代码行数:10,代码来源:actions.class.php

示例2: executeMy

 public function executeMy(sfWebRequest $request)
 {
     $this->csrf = CSRF::getToken();
     $this->locations = $this->getUser()->getProfile()->getLocation();
 }
开发者ID:limitium,项目名称:uberlov,代码行数:5,代码来源:actions.class.php

示例3: executeShow

 public function executeShow(sfWebRequest $request)
 {
     $this->profile = Doctrine::getTable('sfGuardUserProfile')->createQuery("p")->leftJoin('p.VoteProfile')->leftJoin('p.User')->where('p.id = ?', $request->getParameter('id'))->execute()->getFirst();
     $this->forward404Unless($this->profile);
     $this->view = $request->getParameter('view');
     if (!in_array($this->view, array('comments', 'profits', 'locations'))) {
         $this->view = 'profile';
     }
     //@todo: join commmented objects
     $this->comments = Doctrine_Query::create()->from('Comment c')->leftJoin('c.VoteComment')->where('c.created_by = ? and c.parent > 0', $this->profile->getId())->andWhere('c.inbox_id is null')->orderBy('c.created_at desc');
     $this->comments = Doctrine::getTable('Comment')->filterScope($this->comments, $this->getUser())->execute();
     $this->profits = Doctrine_Query::create()->from('Profit p')->leftJoin('p.ProfitDetail d')->leftJoin('p.Location l')->leftJoin('d.Fish f')->leftJoin('d.Style s')->leftJoin('p.CommentProfit')->leftJoin('p.VoteProfit')->andWhere('p.created_by = ?', $this->profile->getId())->orderBy('p.created_at desc');
     $this->profits = Doctrine::getTable('Location')->filterScope($this->profits, $this->getUser())->execute();
     $this->locations = Doctrine::getTable('Location')->getVisibleLocationsQuery($this->getUser())->leftJoin('l.VoteLocation v')->leftJoin('l.CommentLocation c')->andWhere('l.created_by = ?', $this->profile->getId())->orderBy('l.created_at desc')->execute();
     //@todo: add events
     $this->total = 0;
     $this->best = array('name' => 'фигавль', 'qty' => 0, 'location' => null);
     foreach ($this->profits as $profit) {
         if ($this->best['qty'] < $profit->getWeight()) {
             $this->best['qty'] = $profit->getWeight();
             $this->best['name'] = $profit->getFish();
             $this->best['location'] = $profit->getLocation();
         }
         foreach ($profit->getProfitDetail() as $pd) {
             $this->total += $pd->getQty();
         }
     }
     $this->csrf = CSRF::getToken();
 }
开发者ID:limitium,项目名称:uberlov,代码行数:29,代码来源:actions.class.php


注:本文中的CSRF::getToken方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。