function startup(&$controller) { $controller->invalidToken = true; $token = cmsFramework::getToken(); Sanitize::getString($controller->params['form'], $token) and $controller->invalidToken = false; }
function removeToken($token, $app = 'jreviews') { $tokenKeys = cmsFramework::getToken(false); $session =& JFactory::getSession(); unset($tokenKeys['Keys'][array_search($token, $tokenKeys['Keys'])]); }
function token($id = 'mvcToken') { $token = cmsFramework::getToken(); return $this->hidden('data[__Token][Key]', array('id' => $id, 'value' => $token)); }
/** * 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); }
/** * Used in xajax forms when validation fails because the original token is destroyed * */ function reissueToken() { return cmsFramework::getToken(); }