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


PHP Phprojekt::createCsrfToken方法代码示例

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


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

示例1: setRequestUrl

 /**
  * Set the Url
  */
 public function setRequestUrl($url)
 {
     $this->request->setBaseUrl($this->config->webpath . 'index.php/' . $url);
     $this->request->setPathInfo('/' . $url);
     $this->request->setRequestUri('/' . $url);
     $this->request->setParam('csrfToken', Phprojekt::createCsrfToken());
 }
开发者ID:penSecIT,项目名称:PHProjekt,代码行数:10,代码来源:FrontInit.php

示例2: jsonGetConfigurationsAction

 /**
  * Returns the front configurations from the configuration.php (front.xxx),
  * and some others Core Settings.
  *
  * The return is an array like ('name' => varName, 'value' => varValue')
  *
  * The return is in JSON format.
  *
  * @return void
  */
 public function jsonGetConfigurationsAction()
 {
     $fronVars = Phprojekt::getInstance()->getConfig()->front;
     $data = array();
     if (null !== $fronVars) {
         foreach ($fronVars as $key => $value) {
             $data[] = array('name' => $key, 'value' => $value);
         }
     }
     // System info
     $data[] = array('name' => 'phprojektVersion', 'value' => Phprojekt::getVersion());
     $data[] = array('name' => 'currentUserId', 'value' => Phprojekt_Auth::getUserId());
     $data[] = array('name' => 'csrfToken', 'value' => Phprojekt::createCsrfToken());
     Phprojekt_Converter_Json::echoConvert($data);
 }
开发者ID:joerch,项目名称:PHProjekt,代码行数:25,代码来源:IndexController.php

示例3: jsonGetConfigurationsAction

 /**
  * Returns the front configurations from the configuration.php (front.xxx),
  * and some others Core Settings.
  *
  * The return is an array like ('name' => varName, 'value' => varValue')
  *
  * The return is in JSON format.
  *
  * @return void
  */
 public function jsonGetConfigurationsAction()
 {
     $fronVars = Phprojekt::getInstance()->getConfig()->front;
     $data = array();
     if (null !== $fronVars) {
         foreach ($fronVars as $key => $value) {
             $data[] = array('name' => $key, 'value' => $value);
         }
     }
     $user = Phprojekt_Auth_Proxy::getEffectiveUser();
     $settings = $user->settings->fetchAll();
     $tutorialDisplayed = "false";
     foreach ($settings as $setting) {
         if ($setting->keyValue == "tutorialDisplayed") {
             $tutorialDisplayed = $setting->value;
             break;
         }
     }
     // System info
     $data[] = array('name' => 'phprojektVersion', 'value' => Phprojekt::getVersion());
     $data[] = array('name' => 'currentUserId', 'value' => $user->id);
     $data[] = array('name' => 'currentUserName', 'value' => $user->username);
     $data[] = array('name' => 'csrfToken', 'value' => Phprojekt::createCsrfToken());
     $data[] = array('name' => 'tutorialDisplayed', 'value' => $tutorialDisplayed);
     Phprojekt_Converter_Json::echoConvert($data);
 }
开发者ID:RainyBlueSky,项目名称:PHProjekt,代码行数:36,代码来源:IndexController.php


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