mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 20:16:08 +08:00
parent
fc7fc41383
commit
b26c67dd3c
|
@ -42,6 +42,7 @@ class DataFromUser implements ProvidesData
|
|||
'database' => $this->ask('Database name:'),
|
||||
'username' => $this->ask('Database user:'),
|
||||
'password' => $this->secret('Database password:'),
|
||||
'password_confirmation' => $this->secret('Database password (confirmation):'),
|
||||
'prefix' => $this->ask('Prefix:'),
|
||||
];
|
||||
}
|
||||
|
@ -56,6 +57,7 @@ class DataFromUser implements ProvidesData
|
|||
return [
|
||||
'username' => $this->ask('Admin username:'),
|
||||
'password' => $this->secret('Admin password:'),
|
||||
'password_confirmation' => $this->secret('Admin password (confirmation):'),
|
||||
'email' => $this->ask('Admin email address:'),
|
||||
];
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ class DefaultData implements ProvidesData
|
|||
'database' => 'flarum',
|
||||
'username' => 'root',
|
||||
'password' => 'root',
|
||||
'password_confirmation' => 'root',
|
||||
'prefix' => '',
|
||||
];
|
||||
|
||||
|
@ -26,6 +27,7 @@ class DefaultData implements ProvidesData
|
|||
protected $adminUser = [
|
||||
'username' => 'admin',
|
||||
'password' => 'admin',
|
||||
'password_confirmation' => 'admin',
|
||||
'email' => 'admin@example.com',
|
||||
];
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user