-
-
Notifications
You must be signed in to change notification settings - Fork 777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI update user #1602
CLI update user #1602
Conversation
FreshRSS#1600 Not tested
@oupala Here is a patch, but not tested at all. Would you like to give it a spin? |
I tested your patch (congrats for the reactivity !) and I got a few things to mention. All tests have been performed on Alkarex/FreshRSS:cli_update_user.
>sudo ./do-install.php --default-user myuser --language fr --api-enabled --db-type sqlite
Usage: do-install.php --default_user admin ( --auth_type form --environment production --base_url https://rss.example.net/ --language en --title FreshRSS --allow_anonymous --api_enabled --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123 --db-base freshrss --db-prefix freshrss_ --disable_update ) Parameters are sometime using It should be
inline help: >sudo ./update-user.php --usser myuser --password 'apassword'
Usage: update-user.php --user username ( --password 'password' --api-password 'api_password' --language en --email user@example.net --token 'longRandomString' )
>sudo ./update-user.php --user myuser --password 'anotherpassword'
FreshRSS updating user “myuser”…
Result: success Any clue, trying to debug this ?
I'd like to have just a notification that the login failed, and to still be able to login without reloading the login page. Could it be possible? Once again, tell my if you need me to open a new issue for this item as it is about the login page. |
Thanks for the feedback. No need for dedicated issues yet, as long as it is related to this pull request.
|
Now that the usage consistency problem is fixed, there is another consistency problem: >sudo ./update-user.php --usser myuser --password 'apassword'
Usage: update-user.php --user username ( --password 'password' --api-password 'api_password' --language en --email user@example.net --token 'longRandomString' --purge_after_months 3 --feed_min_articles_default 50 --feed_ttl_default 3600 --since_hours_posts_per_rss 168 --min_posts_per_rss 2 --max_posts_per_rss 400 )
>sudo ./create-user.php --usser myuser --password 'apassword'
Usage: create-user.php --user username ( --password 'password' --api-password 'api_password' --language en --email user@example.net --token 'longRandomString --no-default-feeds' ) The following parameters are only available while updating a user, but not when creating it.
And there's a typo in
Quotes are misplaced. They should be like that!
|
I succeeded to use the I only tried to update the password. But I suppose if one parameter works, the others should work either. So, the script seems to be pretty much validated! |
Thanks @oupala |
I understand your point of view. The famous DRY principle. But following this principle, why not merge both script and create a |
Yes indeed, it would be possible to merge both scripts. However, the logic is not exactly the same in both (create user should fail if the username is taken, while update-user should fail if the username does not exist), and not all options make sense in both (e.g. |
You're right on all points. I let you decide what is the best solution to get as less repeated code as possible. Thanks anyway for adding the update user feature so quickly. |
@oupala I have made an update to mutualise create-user and update-user, to get the same options. Not tested. Could you please give it a try? |
@oupala Merged in /dev. Tests welcome :-) |
Seems to be ok. I juste tested dev branch and I succeeded to change my password via the CLI. |
CLI update user
#1600
Not tested