Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT #5024 Installer now checks that the user has entered a us…

…ername and password correctly for the default admin, an additional button for re-checking requirements is now found at the bottom of the admin configuration section

ENHANCEMENT Error messages for database AND admin configuration are now in the same place at the top of the installer (from r99841)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@112182 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit cf647f463e0e72dd270d9c04f515e0925def1cb1 1 parent acbe3b9
sminnee authored
Showing with 16 additions and 2 deletions.
  1. +16 −2 install.php
View
18 install.php
@@ -118,7 +118,7 @@
if($usingEnv) {
$_REQUEST['admin'] = $adminConfig = array(
'username' => defined('SS_DEFAULT_ADMIN_USERNAME') ? SS_DEFAULT_ADMIN_USERNAME : 'admin',
- 'password' => defined('SS_DEFAULT_ADMIN_PASSWORD') ? SS_DEFAULT_ADMIN_PASSWORD : 'password',
+ 'password' => defined('SS_DEFAULT_ADMIN_PASSWORD') ? SS_DEFAULT_ADMIN_PASSWORD : '',
'firstname' => $_REQUEST['admin']['firstname'],
'surname' => $_REQUEST['admin']['surname']
);
@@ -128,7 +128,7 @@
} else {
$_REQUEST['admin'] = $adminConfig = array(
'username' => defined('SS_DEFAULT_ADMIN_USERNAME') ? SS_DEFAULT_ADMIN_USERNAME : 'admin',
- 'password' => defined('SS_DEFAULT_ADMIN_PASSWORD') ? SS_DEFAULT_ADMIN_PASSWORD : 'password',
+ 'password' => defined('SS_DEFAULT_ADMIN_PASSWORD') ? SS_DEFAULT_ADMIN_PASSWORD : '',
'firstname' => '',
'surname' => ''
);
@@ -173,6 +173,11 @@
$dbReq->checkdatabase($databaseConfig);
}
+if($adminConfig) {
+ $adminReq = new InstallRequirements();
+ $adminReq->checkAdminConfig($adminConfig);
+}
+
// Actual processor
$installFromCli = (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'install');
@@ -259,6 +264,15 @@ function checkdatabase($databaseConfig) {
}
}
+ function checkAdminConfig($adminConfig) {
+ if(!$adminConfig['username']) {
+ $this->error(array('', 'Please enter a username!'));
+ }
+ if(!$adminConfig['password']) {
+ $this->error(array('', 'Please enter a password!'));
+ }
+ }
+
/**
* Check everything except the database
*/
Please sign in to comment.
Something went wrong with that request. Please try again.