1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 15:34:26 +02:00

Require password confirmation in console installer

Refs #405.
This commit is contained in:
Franz Liedke
2015-09-04 11:57:11 +02:00
parent fc7fc41383
commit b26c67dd3c
3 changed files with 27 additions and 15 deletions

View File

@@ -128,6 +128,10 @@ class InstallCommand extends Command
{
$dbConfig = $this->dataSource->getDatabaseConfiguration();
if ($dbConfig['password'] !== $dbConfig['password_confirmation']) {
throw new Exception('The password did not match it\'s confirmation.');
}
$config = [
'debug' => true,
'database' => [
@@ -247,6 +251,10 @@ class InstallCommand extends Command
{
$admin = $this->dataSource->getAdminUser();
if ($admin['password'] !== $admin['password_confirmation']) {
throw new Exception('The password did not match it\'s confirmation.');
}
$this->info('Creating admin user '.$admin['username']);
User::unguard();