本文整理汇总了PHP中Cx\Core\Csrf\Controller\Csrf::key方法的典型用法代码示例。如果您正苦于以下问题:PHP Csrf::key方法的具体用法?PHP Csrf::key怎么用?PHP Csrf::key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cx\Core\Csrf\Controller\Csrf
的用法示例。
在下文中一共展示了Csrf::key方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showCategories
/**
* show the categories
*
* @global array module language array
*/
function showCategories()
{
global $_ARRAYLANG;
$catId = !empty($_REQUEST['catId']) ? intval($_REQUEST['catId']) : 0;
$this->_pageTitle = $_ARRAYLANG['TXT_BLOCK_CATEGORIES'];
$this->_objTpl->loadTemplateFile('module_block_categories.html');
$this->_objTpl->setVariable(array('TXT_BLOCK_CATEGORIES' => $_ARRAYLANG['TXT_BLOCK_CATEGORIES'], 'TXT_BLOCK_CATEGORIES_MANAGE' => $_ARRAYLANG['TXT_BLOCK_CATEGORIES_MANAGE'], 'TXT_BLOCK_CATEGORIES_ADD' => $_ARRAYLANG['TXT_BLOCK_CATEGORIES_ADD'], 'TXT_BLOCK_FUNCTIONS' => $_ARRAYLANG['TXT_BLOCK_FUNCTIONS'], 'TXT_BLOCK_NAME' => $_ARRAYLANG['TXT_BLOCK_NAME'], 'TXT_BLOCK_CATEGORY_SEPERATOR' => $_ARRAYLANG['TXT_BLOCK_CATEGORY_SEPERATOR'], 'TXT_BLOCK_PLACEHOLDER' => $_ARRAYLANG['TXT_BLOCK_PLACEHOLDER'], 'TXT_BLOCK_SEPERATOR' => $_ARRAYLANG['TXT_BLOCK_SEPERATOR'], 'TXT_BLOCK_NONE' => $_ARRAYLANG['TXT_BLOCK_NONE'], 'TXT_BLOCK_PARENT' => $_ARRAYLANG['TXT_BLOCK_PARENT'], 'TXT_BLOCK_SELECT_ALL' => $_ARRAYLANG['TXT_BLOCK_SELECT_ALL'], 'TXT_BLOCK_DESELECT_ALL' => $_ARRAYLANG['TXT_BLOCK_DESELECT_ALL'], 'TXT_BLOCK_SUBMIT_SELECT' => $_ARRAYLANG['TXT_BLOCK_SUBMIT_SELECT'], 'TXT_BLOCK_SUBMIT_DELETE' => $_ARRAYLANG['TXT_BLOCK_SUBMIT_DELETE'], 'TXT_BLOCK_NO_CATEGORIES_FOUND' => $_ARRAYLANG['TXT_BLOCK_NO_CATEGORIES_FOUND'], 'TXT_BLOCK_OPERATION_IRREVERSIBLE' => $_ARRAYLANG['TXT_BLOCK_OPERATION_IRREVERSIBLE'], 'BLOCK_CATEGORIES_PARENT_DROPDOWN' => $this->_getCategoriesDropdown(), 'DIRECTORY_INDEX' => CONTREXX_DIRECTORY_INDEX, 'CSRF_KEY' => \Cx\Core\Csrf\Controller\Csrf::key(), 'CSRF_CODE' => \Cx\Core\Csrf\Controller\Csrf::code()));
$arrCategories = $this->_getCategories(true);
if (count($arrCategories) == 0) {
$this->_objTpl->touchBlock('noCategories');
return;
}
$this->_objTpl->hideBlock('noCategories');
$this->_parseCategories($arrCategories[0]);
//first array contains all root categories (parent id 0)
}
示例2: header
<?php
header("content-type: application/javascript");
if (strpos(dirname(__FILE__), 'customizing') === false) {
$contrexx_path = dirname(dirname(dirname(__FILE__)));
} else {
// this files resides within the customizing directory, therefore we'll have to strip
// out one directory more than usually
$contrexx_path = dirname(dirname(dirname(dirname(__FILE__))));
}
require_once $contrexx_path . '/core/Core/init.php';
$cx = init('minimal');
$sessionObj = \cmsSession::getInstance();
$_SESSION->cmsSessionStatusUpdate('backend');
$CSRF = '&' . \Cx\Core\Csrf\Controller\Csrf::key() . '=' . \Cx\Core\Csrf\Controller\Csrf::code();
$langId = !empty($_GET['langId']) ? $_GET['langId'] : null;
$pageId = !empty($_GET['pageId']) ? $_GET['pageId'] : null;
//'&' must not be htmlentities, used in javascript
$defaultBrowser = ASCMS_PATH_OFFSET . ASCMS_BACKEND_PATH . '/' . CONTREXX_DIRECTORY_INDEX . '?cmd=FileBrowser&standalone=true&langId=' . $langId . $CSRF;
$linkBrowser = ASCMS_PATH_OFFSET . ASCMS_BACKEND_PATH . '/' . CONTREXX_DIRECTORY_INDEX . '?cmd=FileBrowser&standalone=true&langId=' . $langId . '&type=webpages' . $CSRF;
//get the main domain
$domainRepository = new \Cx\Core\Net\Model\Repository\DomainRepository();
$mainDomain = $domainRepository->getMainDomain()->getName();
//find the right css files and put it into the wysiwyg
$em = $cx->getDb()->getEntityManager();
$componentRepo = $em->getRepository('Cx\\Core\\Core\\Model\\Entity\\SystemComponent');
$wysiwyg = $componentRepo->findOneBy(array('name' => 'Wysiwyg'));
$pageRepo = $em->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');
\Cx\Core\Setting\Controller\Setting::init('Wysiwyg', 'config', 'Yaml');
$skinId = 0;
if (!empty($pageId) && $pageId != 'new') {