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


PHP BasicAuth::protect_entire_site方法代碼示例

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


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

示例1: setUpOnce

 public function setUpOnce()
 {
     parent::setUpOnce();
     Restrictable::set_enabled(false);
     BasicAuth::protect_entire_site(false);
     // needs to be done this way to work around SS bug
     //		include_once dirname(dirname(__FILE__)).'/extensions/Restrictable.php';
     //		Object::add_extension('PrivateObject', 'Restrictable');
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-restrictedobjects,代碼行數:9,代碼來源:TestRestrictedObject.php

示例2: setUp

 function setUp()
 {
     parent::setUp();
     $this->mainSession = new TestSession();
     // Disable theme, if necessary
     if ($this->stat('disable_themes')) {
         SSViewer::set_theme(null);
     }
     // Switch to draft site, if necessary
     if ($this->stat('use_draft_site')) {
         $this->useDraftSite();
     }
     // Unprotect the site, tests are running with the assumption it's off. They will enable it on a case-by-case basis.
     BasicAuth::protect_entire_site(false);
     SecurityToken::disable();
 }
開發者ID:hamishcampbell,項目名稱:silverstripe-sapphire,代碼行數:16,代碼來源:FunctionalTest.php

示例3: setUp

 public function setUp()
 {
     // Skip calling FunctionalTest directly.
     if (get_class($this) == "FunctionalTest") {
         $this->skipTest = true;
     }
     parent::setUp();
     $this->mainSession = new TestSession();
     // Disable theme, if necessary
     if (static::get_disable_themes()) {
         Config::inst()->update('SSViewer', 'theme', null);
     }
     // Switch to draft site, if necessary
     if (static::get_use_draft_site()) {
         $this->useDraftSite();
     }
     // Unprotect the site, tests are running with the assumption it's off. They will enable it on a case-by-case
     // basis.
     BasicAuth::protect_entire_site(false);
     SecurityToken::disable();
 }
開發者ID:jareddreyer,項目名稱:catalogue,代碼行數:21,代碼來源:FunctionalTest.php

示例4: init

 public function init()
 {
     BasicAuth::protect_entire_site(false);
     parent::init();
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-emailbouncehandler,代碼行數:5,代碼來源:Email_BounceHandler.php

示例5: array

<?php

global $project;
$project = 'mysite';
global $database;
$database = 'SS_ssnewdocstest';
require_once 'conf/ConfigureFromEnv.php';
MySQLDatabase::set_connection_charset('utf8');
// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.org/themes/
SSViewer::set_theme('docs');
// enable nested URLs for this site (e.g. page/sub-page/)
SiteTree::enable_nested_urls();
// render the user documentation first
Director::addRules(20, array('Security//$Action/$ID/$OtherID' => 'Security'));
DocumentationViewer::set_link_base('');
DocumentationViewer::$check_permission = false;
Director::addRules(10, array('$Action' => 'DocumentationViewer', '' => '->current/en/cms'));
DocumentationService::set_automatic_registration(false);
DocumentationService::register("cms", realpath("../../master/cms/docs/"), '2.4');
// We want this to be reviewed by the whole community
BasicAuth::protect_entire_site(false);
開發者ID:NARKOZ,項目名稱:silverstripe-doc-restructuring,代碼行數:22,代碼來源:_config.php

示例6: dirname

if (!isset($database) || !$database) {
    // if SS_DATABASE_CHOOSE_NAME
    if (defined('SS_DATABASE_CHOOSE_NAME') && SS_DATABASE_CHOOSE_NAME) {
        $loopCount = (int) SS_DATABASE_CHOOSE_NAME;
        $databaseDir = dirname($_SERVER['SCRIPT_FILENAME']);
        for ($i = 0; $i < $loopCount; $i++) {
            $databaseDir = dirname($databaseDir);
        }
        $database = "SS_" . basename($databaseDir);
        $database = str_replace('.', '', $database);
    }
}
if (defined('SS_DATABASE_USERNAME') && defined('SS_DATABASE_PASSWORD')) {
    global $databaseConfig;
    $databaseConfig = array("type" => "MySQLDatabase", "server" => defined('SS_DATABASE_SERVER') ? SS_DATABASE_SERVER : 'localhost', "username" => SS_DATABASE_USERNAME, "password" => SS_DATABASE_PASSWORD, "database" => (defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : '') . $database . (defined('SS_DATABASE_SUFFIX') ? SS_DATABASE_SUFFIX : ''));
}
if (defined('SS_SEND_ALL_EMAILS_TO')) {
    Email::send_all_emails_to(SS_SEND_ALL_EMAILS_TO);
}
if (defined('SS_DEFAULT_ADMIN_USERNAME')) {
    if (!defined('SS_DEFAULT_ADMIN_PASSWORD')) {
        user_error("SS_DEFAULT_ADMIN_PASSWORD must be defined in your _ss_environment.php, if SS_DEFAULT_ADMIN_USERNAME is defined.  See http://doc.silverstripe.com/doku.php?id=environment-management for more infomration", E_USER_ERROR);
    }
    Security::setDefaultAdmin(SS_DEFAULT_ADMIN_USERNAME, SS_DEFAULT_ADMIN_PASSWORD);
}
if (defined('SS_USE_BASIC_AUTH') && SS_USE_BASIC_AUTH) {
    BasicAuth::protect_entire_site();
}
if (defined('SS_ERROR_LOG')) {
    Debug::log_errors_to(SS_ERROR_LOG);
}
開發者ID:racontemoi,項目名稱:shibuichi,代碼行數:31,代碼來源:ConfigureFromEnv.php

示例7: init

 public function init()
 {
     BasicAuth::protect_entire_site(true, null);
     parent::init();
 }
開發者ID:nicocin,項目名稱:silverstripe-framework,代碼行數:5,代碼來源:BasicAuthTest.php

示例8: invalid

    public function invalid()
    {
        BasicAuth::protect_entire_site(false);
        $out = <<<XML
<?xml version="1.0"?>
<test>
\t<fail><invalid>
</test>
XML;
        header('Content-type: text/xml');
        echo $out;
    }
開發者ID:NARKOZ,項目名稱:silverstripe-doc-restructuring,代碼行數:12,代碼來源:RestfulServiceTest.php

示例9: define

<?php

global $project;
$project = 'mysite';
// use the _ss_environment.php file for configuration
require_once 'conf/ConfigureFromEnv.php';
// set default language
i18n::set_locale('en_US');
define('PROJECT_THIRDPARTY_DIR', project() . '/thirdparty');
define('PROJECT_THIRDPARTY_PATH', BASE_PATH . '/' . PROJECT_THIRDPARTY_DIR);
if (SS_IS_TEST_ENV) {
    BasicAuth::protect_entire_site(true);
}
if (Director::isLive()) {
    if (strpos(Director::absoluteBaseURL(), 'silverstripe-europe.org') !== false || strpos(Director::absoluteBaseURL(), 'www') !== false) {
        $response = new SS_HTTPResponse();
        $response->redirect('https://stripecon.eu', 301);
        HTTP::add_cache_headers($response);
        $response->output();
        die;
    }
    // we are in live mode, send errors per email, set cache and force WWW
    HTTP::set_cache_age(3600);
    // HTTP Header for CloudFlare Caching
    SS_Cache::set_cache_lifetime('any', 10800);
    // Serverside cache to 3 hours.
    SS_Log::add_writer(new SS_LogEmailWriter('info@silverstripe-europe.org'), SS_Log::ERR);
}
Config::inst()->update('HtmlEditorField', 'use_gzip', false);
開發者ID:silverstripe-europe-meetup,項目名稱:website-2015,代碼行數:29,代碼來源:_config.php

示例10: index

 function index()
 {
     BasicAuth::protect_entire_site(false);
     return "ok";
 }
開發者ID:SustainableCoastlines,項目名稱:loveyourwater,代碼行數:5,代碼來源:WebserverRoutingTest.php


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