From 0712a516e0bd72c283db0ff3acc9d72279df6a5a Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sun, 22 Feb 2009 20:10:53 +0000 Subject: [PATCH] API CHANGE: SS_USE_BASIC_AUTH is available when using ConfigureFromEnv.php git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@72050 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- conf/ConfigureFromEnv.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/ConfigureFromEnv.php b/conf/ConfigureFromEnv.php index 53c26a330..2dac47b30 100644 --- a/conf/ConfigureFromEnv.php +++ b/conf/ConfigureFromEnv.php @@ -26,6 +26,7 @@ * You can configure the default admin with these defines * - SS_DEFAULT_ADMIN_USERNAME: The username of the default admin - this is a non-database user with administrative privileges. * - SS_DEFAULT_ADMIN_PASSWORD: The password of the default admin. + * - SS_USE_BASIC_AUTH: Protect the site with basic auth (good for test sites) * * Email: * - SS_SEND_ALL_EMAILS_TO: If you set this define, all emails will be redirected to this address. @@ -82,7 +83,10 @@ 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::enable(); +} if(defined('SS_ERROR_LOG')) { Debug::log_errors_to(SS_ERROR_LOG); -} \ No newline at end of file +}