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