From 1f8f79d27296410210c7753b6cd90af36ac2a10f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 21:45:52 +0930 Subject: [PATCH] Don't require database password confirmation --- src/Install/Actions/InstallAction.php | 13 ++++++------- src/Install/Console/DataFromUser.php | 13 ++++++------- src/Install/Console/DefaultData.php | 13 ++++++------- src/Install/Console/InstallCommand.php | 6 +----- views/install/install.php | 7 +++++-- 5 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/Install/Actions/InstallAction.php b/src/Install/Actions/InstallAction.php index fc26f7d83..471154603 100644 --- a/src/Install/Actions/InstallAction.php +++ b/src/Install/Actions/InstallAction.php @@ -54,13 +54,12 @@ class InstallAction extends Action $data = new DefaultData; $data->setDatabaseConfiguration([ - 'driver' => 'mysql', - 'host' => array_get($input, 'mysqlHost'), - 'database' => array_get($input, 'mysqlDatabase'), - 'username' => array_get($input, 'mysqlUsername'), - 'password' => array_get($input, 'mysqlPassword'), - 'password_confirmation' => array_get($input, 'mysqlPasswordConfirmation'), - 'prefix' => array_get($input, 'tablePrefix'), + 'driver' => 'mysql', + 'host' => array_get($input, 'mysqlHost'), + 'database' => array_get($input, 'mysqlDatabase'), + 'username' => array_get($input, 'mysqlUsername'), + 'password' => array_get($input, 'mysqlPassword'), + 'prefix' => array_get($input, 'tablePrefix'), ]); $data->setAdminUser([ diff --git a/src/Install/Console/DataFromUser.php b/src/Install/Console/DataFromUser.php index 98ebc09fc..363b42a0a 100644 --- a/src/Install/Console/DataFromUser.php +++ b/src/Install/Console/DataFromUser.php @@ -37,13 +37,12 @@ class DataFromUser implements ProvidesData public function getDatabaseConfiguration() { return [ - 'driver' => 'mysql', - 'host' => $this->ask('Database host:'), - '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:'), + 'driver' => 'mysql', + 'host' => $this->ask('Database host:'), + 'database' => $this->ask('Database name:'), + 'username' => $this->ask('Database user:'), + 'password' => $this->secret('Database password:'), + 'prefix' => $this->ask('Prefix:'), ]; } diff --git a/src/Install/Console/DefaultData.php b/src/Install/Console/DefaultData.php index 4b60ceb54..29a8a39f0 100644 --- a/src/Install/Console/DefaultData.php +++ b/src/Install/Console/DefaultData.php @@ -13,13 +13,12 @@ namespace Flarum\Install\Console; class DefaultData implements ProvidesData { protected $databaseConfiguration = [ - 'driver' => 'mysql', - 'host' => 'localhost', - 'database' => 'flarum', - 'username' => 'root', - 'password' => 'root', - 'password_confirmation' => 'root', - 'prefix' => '', + 'driver' => 'mysql', + 'host' => 'localhost', + 'database' => 'flarum', + 'username' => 'root', + 'password' => 'root', + 'prefix' => '', ]; protected $baseUrl = 'http://flarum.dev'; diff --git a/src/Install/Console/InstallCommand.php b/src/Install/Console/InstallCommand.php index 384f22ce0..626b41bf6 100644 --- a/src/Install/Console/InstallCommand.php +++ b/src/Install/Console/InstallCommand.php @@ -129,10 +129,6 @@ 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' => [ @@ -253,7 +249,7 @@ 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.'); + throw new Exception('The password did not match its confirmation.'); } $this->info('Creating admin user '.$admin['username']); diff --git a/views/install/install.php b/views/install/install.php index f65eabc86..f6618d5a0 100644 --- a/views/install/install.php +++ b/views/install/install.php @@ -31,9 +31,8 @@
-
- +
@@ -54,6 +53,10 @@
+
+ +
+