本文整理汇总了PHP中cmsFramework::getToken方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsFramework::getToken方法的具体用法?PHP cmsFramework::getToken怎么用?PHP cmsFramework::getToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsFramework
的用法示例。
在下文中一共展示了cmsFramework::getToken方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startup
function startup(&$controller)
{
$controller->invalidToken = true;
$token = cmsFramework::getToken();
Sanitize::getString($controller->params['form'], $token) and $controller->invalidToken = false;
}
示例2: removeToken
function removeToken($token, $app = 'jreviews')
{
$tokenKeys = cmsFramework::getToken(false);
$session =& JFactory::getSession();
unset($tokenKeys['Keys'][array_search($token, $tokenKeys['Keys'])]);
}
示例3: token
function token($id = 'mvcToken')
{
$token = cmsFramework::getToken();
return $this->hidden('data[__Token][Key]', array('id' => $id, 'value' => $token));
}
示例4: _initForm
/**
* Adds the captcha image to forms
* Called via ajax to save unnecessary processing and to avoid issues with cached pages
*/
function _initForm()
{
$form_id = Sanitize::getString($this->data, 'form_id');
$show_captcha = Sanitize::getString($this->data, 'captcha');
if (!$form_id) {
return;
}
if ($show_captcha) {
$captcha = $this->Captcha->displayCode();
$response[] = "jQuery('#{$form_id} div.jr_captcha').html('{$captcha['image']}').fadeIn();";
}
$response[] = "jQuery('span.jr_token :input','#{$form_id}').attr('name','" . cmsFramework::getToken() . "');";
return $this->ajaxResponse($response);
}
示例5: reissueToken
/**
* Used in xajax forms when validation fails because the original token is destroyed
*
*/
function reissueToken()
{
return cmsFramework::getToken();
}