Don't require database password confirmation

This commit is contained in:
Toby Zerner 2015-09-04 21:45:52 +09:30
parent b30004a9d4
commit d549e26a4b
5 changed files with 24 additions and 28 deletions

View File

@ -59,7 +59,6 @@ class InstallAction extends Action
'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'),
]); ]);

View File

@ -42,7 +42,6 @@ class DataFromUser implements ProvidesData
'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:'),
]; ];
} }

View File

@ -18,7 +18,6 @@ class DefaultData implements ProvidesData
'database' => 'flarum', 'database' => 'flarum',
'username' => 'root', 'username' => 'root',
'password' => 'root', 'password' => 'root',
'password_confirmation' => 'root',
'prefix' => '', 'prefix' => '',
]; ];

View File

@ -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']);

View File

@ -31,7 +31,6 @@
<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">
@ -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>