當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Csrf::check_code方法代碼示例

本文整理匯總了PHP中Csrf::check_code方法的典型用法代碼示例。如果您正苦於以下問題:PHP Csrf::check_code方法的具體用法?PHP Csrf::check_code怎麽用?PHP Csrf::check_code使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Csrf的用法示例。


在下文中一共展示了Csrf::check_code方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postResolve

 /**
  * Do something after resolving is done
  *
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function postResolve(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     global $plainCmd, $cmd, $_CORELANG;
     // CSRF code needs to be even in the login form. otherwise, we
     // could not do a super-generic check later.. NOTE: do NOT move
     // this above the "new cmsSession" line!
     Csrf::add_code();
     // CSRF protection.
     // Note that we only do the check as long as there's no
     // cmd given; this is so we can reload the main screen if
     // the check has failed somehow.
     // fileBrowser is an exception, as it eats CSRF codes like
     // candy. We're doing \Cx\Core\Csrf\Controller\Csrf::check_code() in the relevant
     // parts in the module instead.
     // The CSRF code needn't to be checked in the login module
     // because the user isn't logged in at this point.
     // TODO: Why is upload excluded? The CSRF check doesn't take place in the upload module!
     if (!empty($plainCmd) && !empty($cmd) and !in_array($plainCmd, array('FileBrowser', 'Upload', 'Login', 'Home'))) {
         // Since language initialization in in the same hook as this
         // and we cannot define the order of module-processing,
         // we need to check if language is already initialized:
         if (!is_array($_CORELANG) || !count($_CORELANG)) {
             $objInit = \Env::get('init');
             $objInit->_initBackendLanguage();
             $_CORELANG = $objInit->loadLanguageData('core');
         }
         Csrf::check_code();
     }
 }
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:34,代碼來源:ComponentController.class.php


注:本文中的Csrf::check_code方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。