diff options
| author | 2017-08-19 16:26:17 +0200 | |
|---|---|---|
| committer | 2017-08-19 16:26:17 +0200 | |
| commit | f09039b1da9c49dc616277f47b3deef1ca92f127 (patch) | |
| tree | 7476dba425a794c516ded6c1a111ea68b8b55967 /cli/create-user.php | |
| parent | 19df77c249f23f00d247799ca9deaf4fd923e2bf (diff) | |
| parent | 4a813ff06fc06d1ce6c9cda2d66ff9895152be89 (diff) | |
Merge pull request #1602 from Alkarex/cli_update_user
CLI update user
Diffstat (limited to 'cli/create-user.php')
| -rwxr-xr-x | cli/create-user.php | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/cli/create-user.php b/cli/create-user.php index f44591cc9..add9c1b13 100755 --- a/cli/create-user.php +++ b/cli/create-user.php @@ -1,21 +1,8 @@ #!/usr/bin/php <?php -require('_cli.php'); - -$options = getopt('', array( - 'user:', - 'password:', - 'api-password:', - 'language:', - 'email:', - 'token:', - 'no-default-feeds', - )); - -if (empty($options['user'])) { - fail('Usage: ' . basename(__FILE__) . " --user username ( --password 'password' --api-password 'api_password'" . - " --language en --email user@example.net --token 'longRandomString --no-default-feeds' )"); -} +$isUpdate = false; +require('_update-or-create-user.php'); + $username = $options['user']; if (!FreshRSS_user_Controller::checkUsername($username)) { fail('FreshRSS error: invalid username “' . $username . '”! Must be matching ' . FreshRSS_user_Controller::USERNAME_PATTERN); @@ -30,11 +17,8 @@ echo 'FreshRSS creating user “', $username, "”…\n"; $ok = FreshRSS_user_Controller::createUser($username, empty($options['password']) ? '' : $options['password'], - empty($options['api-password']) ? '' : $options['api-password'], - array( - 'language' => empty($options['language']) ? '' : $options['language'], - 'token' => empty($options['token']) ? '' : $options['token'], - ), + empty($options['api_password']) ? '' : $options['api_password'], + $values, !isset($options['no-default-feeds'])); if (!$ok) { |
