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


PHP BasicAuth::protect_site_if_necessary方法代码示例

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


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

示例1: init

 /**
  * Initialisation function that is run before any action on the controller is called.
  *
  * @uses BasicAuth::requireLogin()
  */
 public function init()
 {
     if ($this->basicAuthEnabled) {
         BasicAuth::protect_site_if_necessary();
     }
     // This is used to test that subordinate controllers are actually calling parent::init() - a common bug
     $this->baseInitCalled = true;
 }
开发者ID:nickbooties,项目名称:silverstripe-framework,代码行数:13,代码来源:Controller.php

示例2: init

	/**
	 * Initialisation function that is run before any action on the controller is called.
	 * 
	 * @uses BasicAuth::requireLogin()
	 */
	function init() {
		if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();

		// Directly access the session variable just in case the Group or Member tables don't yet exist
		if(Session::get('loggedInAs') && Security::database_is_ready()) {
			$member = Member::currentUser();
			if($member) {
				if(!headers_sent()) Cookie::set("PastMember", true, 90, null, null, false, true);
				DB::query("UPDATE \"Member\" SET \"LastVisited\" = " . DB::getConn()->now() . " WHERE \"ID\" = $member->ID", null);
			}
		}
		
		// This is used to test that subordinate controllers are actually calling parent::init() - a common bug
		$this->baseInitCalled = true;
	}
开发者ID:redema,项目名称:sapphire,代码行数:20,代码来源:Controller.php

示例3: init

 /**
  * Initialisation function that is run before any action on the controller is called.
  *
  * @uses BasicAuth::requireLogin()
  */
 public function init()
 {
     if ($this->basicAuthEnabled) {
         BasicAuth::protect_site_if_necessary();
     }
     // Directly access the session variable just in case the Group or Member tables don't yet exist
     if (Member::config()->log_last_visited) {
         Deprecation::notice('4.0', 'Member::$LastVisited is deprecated. From 4.0 onwards you should implement this as a custom extension');
         if (Session::get('loggedInAs') && Security::database_is_ready() && ($member = Member::currentUser())) {
             DB::prepared_query(sprintf('UPDATE "Member" SET "LastVisited" = %s WHERE "ID" = ?', DB::get_conn()->now()), array($member->ID));
         }
     }
     // This is used to test that subordinate controllers are actually calling parent::init() - a common bug
     $this->baseInitCalled = true;
 }
开发者ID:miamollie,项目名称:echoAerial,代码行数:20,代码来源:Controller.php

示例4: init

 /**
  * Initialisation function that is run before any action on the controller is called.
  * 
  * @uses BasicAuth::requireLogin()
  */
 function init()
 {
     if ($this->basicAuthEnabled) {
         BasicAuth::protect_site_if_necessary();
     }
     // Directly access the session variable just in case the Group or Member tables don't yet exist
     if (Session::get('loggedInAs') && Security::database_is_ready()) {
         if ($member = Member::currentUser()) {
             if (!headers_sent()) {
                 Cookie::set("PastMember", true);
             }
             DB::query("UPDATE Member SET LastVisited = NOW() WHERE ID = {$member->ID}", null);
         }
     }
     // This is used to test that subordinate controllers are actually calling parent::init() - a common bug
     $this->baseInitCalled = true;
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:22,代码来源:Controller.php


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