當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。