From 603f1e699676184bc54d3a9bc6a5764f55768206 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sun, 10 Feb 2008 22:58:58 +0000 Subject: [PATCH] Added SS_DEFAULT_ADMIN_USERNAME/PASSWORD defines to conf/ConfigureFromEnv.php git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@49301 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- conf/ConfigureFromEnv.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/conf/ConfigureFromEnv.php b/conf/ConfigureFromEnv.php index c71e840c2..475a63054 100644 --- a/conf/ConfigureFromEnv.php +++ b/conf/ConfigureFromEnv.php @@ -17,6 +17,10 @@ * You can configure the environment with this define: * - SS_ENVIRONMENT_TYPE: The environment type: dev, test or live. * + * 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. + * * Email: * - SS_SEND_ALL_EMAILS_TO: If you set this define, all emails will be redirected to this address. * @@ -50,3 +54,8 @@ $databaseConfig = array( 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); +}