diff --git a/app/commands/AppCommand.php b/app/commands/AppCommand.php index 362054a4aa..5f50499bb4 100755 --- a/app/commands/AppCommand.php +++ b/app/commands/AppCommand.php @@ -222,12 +222,23 @@ class AppCommand extends Command { do { // Ask the user to input the user password - $password = $this->ask('Please enter your user password (at least 8 characters): '); + $password = $this->secret('Please enter your user password (at least 8 characters): '); + $password1 = $this->secret('Please confirm your user password: '); // Check if password is valid - if ($password == '') { + if ($password == '' || $password1 == '') { // Return an error message $this->error('Password is invalid. Please try again.'); + $password = ''; + $password1 = ''; + } + else{ + // Verify the user password + if ($password != $password1){ + $this->error('Password do not match. Please try again.'); + $password = ''; + $password1 = ''; + } } // Store the password @@ -235,19 +246,19 @@ class AppCommand extends Command } while( ! $password); } - /** - * Asks the user to create dummy data - * - * @return void - * @todo Use the Laravel Validator - */ - protected function askUserDummyData() - { - // Ask the user to input the user password - $dummydata = $this->ask('Do you want to seed your database with dummy data? Y/n (default is yes): '); + /** + * Asks the user to create dummy data + * + * @return void + * @todo Use the Laravel Validator + */ + protected function askUserDummyData() + { + // Ask the user to input the user password + $dummydata = $this->ask('Do you want to seed your database with dummy data? y/N (default is no): '); - $this->dummyData = ( strstr($dummydata, 'Y' ) || empty($dummydata) ) ? true : false; - } + $this->dummyData = ( strstr($dummydata, 'N' ) || empty($dummydata) ) ? true : false; + } /** * Runs all the necessary Sentry commands.