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


PHP BasicAuth::entire_site_protected_code方法代码示例

本文整理汇总了PHP中BasicAuth::entire_site_protected_code方法的典型用法代码示例。如果您正苦于以下问题:PHP BasicAuth::entire_site_protected_code方法的具体用法?PHP BasicAuth::entire_site_protected_code怎么用?PHP BasicAuth::entire_site_protected_code使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BasicAuth的用法示例。


在下文中一共展示了BasicAuth::entire_site_protected_code方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 /**
  * Enable protection of the entire site with basic authentication.
  * 
  * This log-in uses the Member database for authentication, but doesn't interfere with the
  * regular log-in form. This can be useful for test sites, where you want to hide the site
  * away from prying eyes, but still be able to test the regular log-in features of the site.
  * 
  * If you are including conf/ConfigureFromEnv.php in your _config.php file, you can also enable
  * this feature by adding this line to your _ss_environment.php:
  * 
  * define('SS_USE_BASIC_AUTH', true);
  * 
  * @param boolean $protect Set this to false to disable protection.
  * @param String $code {@link Permission} code that is required from the user.
  *  Defaults to "ADMIN". Set to NULL to just require a valid login, regardless
  *  of the permission codes a user has.
  */
 static function protect_entire_site($protect = true, $code = 'ADMIN', $message = null)
 {
     self::$entire_site_protected = $protect;
     self::$entire_site_protected_code = $code;
     if ($message) {
         self::$entire_site_protected_message = $message;
     }
 }
开发者ID:prostart,项目名称:cobblestonepath,代码行数:25,代码来源:BasicAuth.php


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