mirror of
https://github.com/flarum/core.git
synced 2025-07-13 12:56:26 +02:00
Don't require database password confirmation
This commit is contained in:
@ -54,13 +54,12 @@ class InstallAction extends Action
|
|||||||
$data = new DefaultData;
|
$data = new DefaultData;
|
||||||
|
|
||||||
$data->setDatabaseConfiguration([
|
$data->setDatabaseConfiguration([
|
||||||
'driver' => 'mysql',
|
'driver' => 'mysql',
|
||||||
'host' => array_get($input, 'mysqlHost'),
|
'host' => array_get($input, 'mysqlHost'),
|
||||||
'database' => array_get($input, 'mysqlDatabase'),
|
'database' => array_get($input, 'mysqlDatabase'),
|
||||||
'username' => array_get($input, 'mysqlUsername'),
|
'username' => array_get($input, 'mysqlUsername'),
|
||||||
'password' => array_get($input, 'mysqlPassword'),
|
'password' => array_get($input, 'mysqlPassword'),
|
||||||
'password_confirmation' => array_get($input, 'mysqlPasswordConfirmation'),
|
'prefix' => array_get($input, 'tablePrefix'),
|
||||||
'prefix' => array_get($input, 'tablePrefix'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data->setAdminUser([
|
$data->setAdminUser([
|
||||||
|
@ -37,13 +37,12 @@ class DataFromUser implements ProvidesData
|
|||||||
public function getDatabaseConfiguration()
|
public function getDatabaseConfiguration()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'driver' => 'mysql',
|
'driver' => 'mysql',
|
||||||
'host' => $this->ask('Database host:'),
|
'host' => $this->ask('Database host:'),
|
||||||
'database' => $this->ask('Database name:'),
|
'database' => $this->ask('Database name:'),
|
||||||
'username' => $this->ask('Database user:'),
|
'username' => $this->ask('Database user:'),
|
||||||
'password' => $this->secret('Database password:'),
|
'password' => $this->secret('Database password:'),
|
||||||
'password_confirmation' => $this->secret('Database password (confirmation):'),
|
'prefix' => $this->ask('Prefix:'),
|
||||||
'prefix' => $this->ask('Prefix:'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,13 +13,12 @@ namespace Flarum\Install\Console;
|
|||||||
class DefaultData implements ProvidesData
|
class DefaultData implements ProvidesData
|
||||||
{
|
{
|
||||||
protected $databaseConfiguration = [
|
protected $databaseConfiguration = [
|
||||||
'driver' => 'mysql',
|
'driver' => 'mysql',
|
||||||
'host' => 'localhost',
|
'host' => 'localhost',
|
||||||
'database' => 'flarum',
|
'database' => 'flarum',
|
||||||
'username' => 'root',
|
'username' => 'root',
|
||||||
'password' => 'root',
|
'password' => 'root',
|
||||||
'password_confirmation' => 'root',
|
'prefix' => '',
|
||||||
'prefix' => '',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $baseUrl = 'http://flarum.dev';
|
protected $baseUrl = 'http://flarum.dev';
|
||||||
|
@ -129,10 +129,6 @@ class InstallCommand extends Command
|
|||||||
{
|
{
|
||||||
$dbConfig = $this->dataSource->getDatabaseConfiguration();
|
$dbConfig = $this->dataSource->getDatabaseConfiguration();
|
||||||
|
|
||||||
if ($dbConfig['password'] !== $dbConfig['password_confirmation']) {
|
|
||||||
throw new Exception('The password did not match it\'s confirmation.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$config = [
|
$config = [
|
||||||
'debug' => true,
|
'debug' => true,
|
||||||
'database' => [
|
'database' => [
|
||||||
@ -253,7 +249,7 @@ class InstallCommand extends Command
|
|||||||
$admin = $this->dataSource->getAdminUser();
|
$admin = $this->dataSource->getAdminUser();
|
||||||
|
|
||||||
if ($admin['password'] !== $admin['password_confirmation']) {
|
if ($admin['password'] !== $admin['password_confirmation']) {
|
||||||
throw new Exception('The password did not match it\'s confirmation.');
|
throw new Exception('The password did not match its confirmation.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->info('Creating admin user '.$admin['username']);
|
$this->info('Creating admin user '.$admin['username']);
|
||||||
|
@ -31,9 +31,8 @@
|
|||||||
<div class="FormField">
|
<div class="FormField">
|
||||||
<label>MySQL Password</label>
|
<label>MySQL Password</label>
|
||||||
<input type="password" name="mysqlPassword">
|
<input type="password" name="mysqlPassword">
|
||||||
<input type="password" name="mysqlPasswordConfirmation">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="FormField">
|
<div class="FormField">
|
||||||
<label>Table Prefix</label>
|
<label>Table Prefix</label>
|
||||||
<input type="text" name="tablePrefix">
|
<input type="text" name="tablePrefix">
|
||||||
@ -54,6 +53,10 @@
|
|||||||
<div class="FormField">
|
<div class="FormField">
|
||||||
<label>Admin Password</label>
|
<label>Admin Password</label>
|
||||||
<input type="password" name="adminPassword">
|
<input type="password" name="adminPassword">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="FormField">
|
||||||
|
<label>Confirm Password</label>
|
||||||
<input type="password" name="adminPasswordConfirmation">
|
<input type="password" name="adminPasswordConfirmation">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user