当前位置: 首页>>代码示例>>PHP>>正文


PHP Framework::getAntiCSRF方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:henrikau,项目名称:confusa,代码行数:32,代码来源:select_email.php

示例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>");
     }
 }
开发者ID:henrikau,项目名称:confusa,代码行数:34,代码来源:Framework.php


注:本文中的Framework::getAntiCSRF方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。