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
This commit is contained in:
Sam Minnee 2008-02-10 22:58:58 +00:00
parent bee4f9423a
commit 603f1e6996

View File

@ -17,6 +17,10 @@
* You can configure the environment with this define: * You can configure the environment with this define:
* - SS_ENVIRONMENT_TYPE: The environment type: dev, test or live. * - 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: * Email:
* - SS_SEND_ALL_EMAILS_TO: If you set this define, all emails will be redirected to this address. * - 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')) { if(defined('SS_SEND_ALL_EMAILS_TO')) {
Email::send_all_emails_to(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);
}