本文整理匯總了PHP中Framework::getAntiCSRF方法的典型用法代碼示例。如果您正苦於以下問題:PHP Framework::getAntiCSRF方法的具體用法?PHP Framework::getAntiCSRF怎麽用?PHP Framework::getAntiCSRF使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Framework
的用法示例。
在下文中一共展示了Framework::getAntiCSRF方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pre_process
/**
* Redirect user immediately to receive_csr step if number e-mail
* addresses is zero or both configured and available addresses equal
* 1. Otherwise, display mail selection form.
* @see Content_Page::pre_process()
*/
function pre_process($person)
{
parent::pre_process($person);
$this->tpl->assign('extraScripts', array('js/jquery-1.6.1.min.js'));
$this->tpl->assign('rawScript', file_get_contents('../include/rawToggleExpand.js'));
$this->person->clearRegCertEmails();
$emailsDesiredByNREN = $this->person->getNREN()->getEnableEmail();
$registeredPersonMails = $this->person->getNumEmails();
$redirect = "receive_csr.php" . "?skipped_email=yes";
$redirect .= "&anticsrf=" . Framework::getAntiCSRF();
switch ($emailsDesiredByNREN) {
case '0':
header("Location: {$redirect}");
exit(0);
break;
case '1':
case 'm':
if ($registeredPersonMails == 1) {
$this->person->regCertEmail($this->person->getEmail());
$this->person->storeRegCertEmails();
header("Location: {$redirect}");
exit(0);
}
break;
}
}
示例2: triggerAdminIssues
/**
* triggerAdminIssues() - post error-messages
*
* Function will report issues in the form of errors to the screen when an
* admin looks at the portal and something is amiss. This includes:
*
* - missing privacy notice for the NREN
* - missing about_nren text
* - incomplete or missing attribute-map
*
* @param void
* @return void
* @access private
*/
private function triggerAdminIssues()
{
if (!isset($this->person)) {
return;
}
$nren = $this->person->getNREN();
if (!$nren) {
return;
}
$url_arg = "?mode=admin&show=text&anticsrf=" . Framework::getAntiCSRF();
if (!$nren->hasHelpText()) {
Framework::warning_output("Missing NREN help-text. <a href=\"stylist.php" . $url_arg . "#edit_help\">Configure</a>");
}
if (!$nren->hasAboutText()) {
Framework::warning_output("Missing About-NREN text. <a href=\"stylist.php" . $url_arg . "#edit_about\">Configure</a>");
}
if (!$nren->hasPrivacyNotice()) {
Framework::warning_output("Missing privacy-notice. <a href=\"stylist.php" . $url_arg . "#edit_pn\">Configure</a>");
}
}