From 9a80dde238caf1338b803f67003cd459393efdc3 Mon Sep 17 00:00:00 2001 From: Kasimir Cash Date: Tue, 9 Jan 2024 22:01:17 +0000 Subject: 2297 cli parameters consistency (#6028) * Updates do-install params * Adds parseCliParams to _cli.php * Updates do-install to use parseCliParams * Updates reconfigure to use parseCliParams * Fixes bug mail_login => email * Update create-user to use parseCliParams * Minor refactor * Updates update-user to use parseCliParams * Fix no_default_feeds => no-default-feeds * Refactors arrays * Updates CLI Readme * Adds docblocks to _cli functions * Sets vars in _cli functions * Fixes indentation * Meeting coding standards around colons * Meeting PHPStan standards * Removes stray whitespace * Meeting PHPStan Next Level standards * More specific typing * Maintaining types * Typing around getopt() * Fixes typo * Fixes typo perameters -> parameters * Removes unused variable * Rewrites deprecation warning message --- cli/create-user.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cli/create-user.php') diff --git a/cli/create-user.php b/cli/create-user.php index c360a88a5..53e0335bc 100755 --- a/cli/create-user.php +++ b/cli/create-user.php @@ -5,7 +5,7 @@ declare(strict_types=1); $isUpdate = false; require(__DIR__ . '/_update-or-create-user.php'); -$username = $GLOBALS['options']['user']; +$username = $GLOBALS['options']['valid']['user']; if (!FreshRSS_user_Controller::checkUsername($username)) { fail('FreshRSS error: invalid username “' . $username . '”! Must be matching ' . FreshRSS_user_Controller::USERNAME_PATTERN); @@ -20,19 +20,19 @@ echo 'FreshRSS creating user “', $username, "”…\n"; $ok = FreshRSS_user_Controller::createUser( $username, - empty($options['mail_login']) ? '' : $options['mail_login'], - empty($options['password']) ? '' : $options['password'], + empty($options['valid']['email']) ? '' : $options['valid']['email'], + empty($options['valid']['password']) ? '' : $options['valid']['password'], $GLOBALS['values'], - !isset($options['no_default_feeds']) + !isset($options['valid']['no-default-feeds']) ); if (!$ok) { fail('FreshRSS could not create user!'); } -if (!empty($options['api_password'])) { +if (!empty($options['valid']['api-password'])) { $username = cliInitUser($username); - $error = FreshRSS_api_Controller::updatePassword($options['api_password']); + $error = FreshRSS_api_Controller::updatePassword($options['valid']['api-password']); if ($error !== false) { fail($error); } -- cgit v1.2.3