mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02:00
#1464 - PHP installer doesn't keep the admin username/password when you 'recheck requirements'
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@43975 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e9ae0ff4b7
commit
4e94efeaaa
@ -120,14 +120,14 @@
|
||||
<h4>SilverStripe Administration Account</h4>
|
||||
|
||||
<p id="AdminAccount">
|
||||
<label for="username">Administrator email:</label>
|
||||
<span class="middleColumn"><input type="text" class="text" name="username" id="username" value="admin" /></span>
|
||||
<label for="password">Administrator password:</label>
|
||||
<span class="middleColumn"><input type="text" class="text" name="password" id="password" value="password" /></span>
|
||||
<label for="firstname">Administrator first name:</label>
|
||||
<span class="middleColumn"><input type="text" class="text" name="firstname" id="firstname" value="" /></span>
|
||||
<label for="surname">Administrator surname:</label>
|
||||
<span class="middleColumn"><input type="text" class="text" name="surname" id="surname" value="" /></span>
|
||||
<label for="admin_username">Administrator email:</label>
|
||||
<span class="middleColumn"><input type="text" class="text" name="admin[username]" id="admin_username" value="<?php echo $adminConfig['username']; ?>" /></span>
|
||||
<label for="admin_password">Administrator password:</label>
|
||||
<span class="middleColumn"><input type="text" class="text" name="admin[password]" id="admin_password" value="<?php echo $adminConfig['password']; ?>" /></span>
|
||||
<label for="admin_firstname">Administrator first name:</label>
|
||||
<span class="middleColumn"><input type="text" class="text" name="admin[firstname]" id="admin_firstname" value="<?php echo $adminConfig['firstname']; ?>" /></span>
|
||||
<label for="admin_surname">Administrator surname:</label>
|
||||
<span class="middleColumn"><input type="text" class="text" name="admin[surname]" id="admin_surname" value="<?php echo $adminConfig['surname']; ?>" /></span>
|
||||
</p>
|
||||
<p class="adminAcc">
|
||||
We will set up 1 administrator account for you automatically. Enter the email address and password. If you'd
|
||||
|
25
install.php
25
install.php
@ -19,6 +19,17 @@ if(isset($_REQUEST['mysql'])) {
|
||||
);
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['admin'])) {
|
||||
$adminConfig = $_REQUEST['admin'];
|
||||
} else {
|
||||
$adminConfig = array(
|
||||
'username' => 'admin',
|
||||
'password' => 'password',
|
||||
'firstname' => '',
|
||||
'surname' => ''
|
||||
);
|
||||
}
|
||||
|
||||
$alreadyInstalled = (file_exists('mysite/_config.php') || file_exists('tutorial/_config.php'));
|
||||
|
||||
if(file_exists('sapphire/silverstripe_version')) {
|
||||
@ -634,22 +645,22 @@ PHP
|
||||
$dbAdmin = new DatabaseAdmin();
|
||||
$dbAdmin->init();
|
||||
|
||||
$_REQUEST['username'] = $_REQUEST['admin']['username'];
|
||||
$_REQUEST['password'] = $_REQUEST['admin']['password'];
|
||||
$dbAdmin->doBuild(true);
|
||||
|
||||
$adminmember = DataObject::get_one('Member',"`Email`= '".$_REQUEST['username']."'");
|
||||
$adminmember = DataObject::get_one('Member',"`Email`= '".$_REQUEST['admin']['username']."'");
|
||||
if($adminmember) {
|
||||
if($adminmember->_isAdmin()){
|
||||
$adminmember->FirstName = $_REQUEST['firstname'];
|
||||
$adminmember->Surname = $_REQUEST['surname'];
|
||||
$adminmember->FirstName = $_REQUEST['admin']['firstname'];
|
||||
$adminmember->Surname = $_REQUEST['admin']['surname'];
|
||||
$adminmember->write();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "<li>Checking mod_rewrite works</li>";
|
||||
|
||||
$_SESSION['username'] = $_REQUEST['username'];
|
||||
$_SESSION['password'] = $_REQUEST['password'];
|
||||
$_SESSION['username'] = $_REQUEST['admin']['username'];
|
||||
$_SESSION['password'] = $_REQUEST['admin']['password'];
|
||||
|
||||
if($this->checkModRewrite()) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user