Skip to content

CLI spark commands to manage users#567

Closed
ghost wants to merge 0 commit intodevelopfrom
unknown repository
Closed

CLI spark commands to manage users#567
ghost wants to merge 0 commit intodevelopfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Dec 22, 2022

With the User command is possible by cli to run these actions on users :
'create', 'activate', 'deactivate', 'changename', 'changeemail', 'delete', 'password', 'list', 'addgroup', 'removegroup'

Available options :
'-i' => 'User id'
'-u' => 'User name'
'-e' => 'User email'
'-nu' => 'New username'
'-ne' => 'New email'
'-g' => 'Group name'

1. create a new user

./spark shield:user create -u newuser -e newuser@myemail.com

2. activate a user

by username : ./spark shield:user activate -u username
or
by email : ./spark shield:user activate -e user@myemail.com

3. deactivate a user

by username : ./spark shield:user deactivate -u username
or
by email : ./spark shield:user deactivate -e user@myemail.com

4. change user name

by username : ./spark shield:user changename -u username -nu newusername
or
by email : ./spark shield:user changename -e user@myemail.com -nu newusername

5. change user email

by username : ./spark shield:user changeemail -u username -ne newuseremail@myemail.com
or
by email : ./spark shield:user changeemail -e user@myemail.com -ne newuseremail@myemail.com

6. delete a user

by user id : ./spark shield:user delete -i 123
or
by username : ./spark shield:user delete -u user
or
by email : ./spark shield:user delete -e user@myemail.com

7. change a user password

by username : ./spark shield:user password -u username
or
by email : ./spark shield:user password -e user@myemail.com

8. list users

List all users : ./spark shield:user list
or filter by username and/or email ./spark shield:user list -u user -e user@myemail.com

9. add a user to a group

by username : ./spark shield:user addgroup -u username -g mygroup
or
by email : ./spark shield:user addgroup -e user@myemail.com -g mygroup

10. remove a user from a group

by username : ./spark shield:user removegroup -u username -g mygroup
or
by email : ./spark shield:user removegroup -e user@myemail.com -g mygroup

All the options are optional and if the username or email are not passed on command line, a prompt will ask the user for the necessary information to complete the required task. The data inserted are validated and every operation asks for a confirmation to proceed.

@ghost ghost mentioned this pull request Dec 22, 2022
@kenjis kenjis added the GPG-Signing needed Pull requests that need GPG-Signing label Dec 23, 2022
@kenjis
Copy link
Member

kenjis commented Dec 23, 2022

@kenjis kenjis added tests needed Pull requests that need tests docs needed Pull requests needing documentation write-ups and/or revisions. labels Dec 23, 2022
@kenjis
Copy link
Member

kenjis commented Dec 23, 2022

You committed some merge commits, but we do not use merge commits in PR branches.
Please use git rebase and it will remove the merge commits.
See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#updating-your-branch

@ghost
Copy link
Author

ghost commented Dec 23, 2022

Hi @kenjis , thanks for the feedback. I made all the necessary amendments to the code. If you think everything is ok, I can work also on the documentation.

@ghost ghost closed this Dec 24, 2022
@datamweb datamweb mentioned this pull request Jan 2, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs needed Pull requests needing documentation write-ups and/or revisions. GPG-Signing needed Pull requests that need GPG-Signing tests needed Pull requests that need tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant