mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02:00
BUGFIX Explicitly set a default administrator in Installer->install() rather than assuming its credentials are set through Security::findAnAdministrator() (see #4271) (from r97479)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@112089 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e8bb141aaa
commit
e012b5a418
17
install.php
17
install.php
@ -860,16 +860,17 @@ PHP
|
||||
$dbAdmin = new DatabaseAdmin();
|
||||
$dbAdmin->init();
|
||||
|
||||
$_REQUEST['username'] = $config['admin']['username'];
|
||||
$_REQUEST['password'] = $config['admin']['password'];
|
||||
$dbAdmin->doBuild(true);
|
||||
|
||||
$adminmember = DataObject::get_one('Member',"\"Email\"= '".$_REQUEST['admin']['username']."'");
|
||||
if($adminmember) {
|
||||
$adminmember->FirstName = $_REQUEST['admin']['firstname'];
|
||||
$adminmember->Surname = $_REQUEST['admin']['surname'];
|
||||
$adminmember->write();
|
||||
}
|
||||
// Create default administrator user and group in database
|
||||
// (not using Security::setDefaultAdmin())
|
||||
$adminMember = Security::findAnAdministrator();
|
||||
$adminMember->Email = $config['admin']['username'];
|
||||
$adminMember->Password = $config['admin']['password'];
|
||||
$adminMember->PasswordEncryption = Security::get_password_encryption_algorithm();
|
||||
$adminMember->FirstName = $config['admin']['firstname'];
|
||||
$adminMember->Surname = $config['admin']['surname'];
|
||||
$adminMember->write();
|
||||
|
||||
// Syncing filesystem (so /assets/Uploads is available instantly, see ticket #2266)
|
||||
FileSystem::sync();
|
||||
|
Loading…
Reference in New Issue
Block a user