Skip to content

Added spark command to manage users#568

Closed
ghost wants to merge 0 commit intodevelopfrom
unknown repository
Closed

Added spark command to manage users#568
ghost wants to merge 0 commit intodevelopfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Dec 24, 2022

Supersedes #567

./spark shield:user

Valid arguments : 'create', 'activate', 'deactivate', 'changename', 'changeemail', 'delete', 'password', 'list', 'addgroup', 'removegroup'

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

@datamweb datamweb added GPG-Signing needed Pull requests that need GPG-Signing tests needed Pull requests that need tests docs needed Pull requests needing documentation write-ups and/or revisions. enhancement New feature or request new feature PRs for new features labels Dec 24, 2022
@ghost
Copy link
Author

ghost commented Dec 24, 2022

Hi @datamweb, I signed my commit. Thanks for the heads-up.

@ghost ghost mentioned this pull request Dec 24, 2022
@datamweb
Copy link
Collaborator

Hello @robertogerola .
I saw that you worked hard.
Thank you for trying.

  1. It is better to create a new branch in each PR post.
    01

How to do this?

git branch feat-add-users-manage-whit-cli
  1. Every commit that is done must be signed.
    02

How to do this?
https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account

  1. We need unit testing for code control and extensibility for each PR.
    How do you do it?
    https://github.com/codeigniter4/CodeIgniter4/tree/develop/tests#resources

  2. I saw your code superficially, your code needs a lot of changes, however I did not review it, I would like you to fix some problems yourself and then I or my colleagues will review it, for example:

  • What is the output of command php spark shield:user? Without performance, it's not interesting.
P:\Bug\project-root>php spark shield:user

CodeIgniter v4.2.10 Command Line Tool - Server Time: 2022-12-24 08:47:09 UTC-06:00
  • The output of command list is not interesting, it can be as follows:
P:\Bug\project-root>php spark shield:user list

CodeIgniter v4.2.10 Command Line Tool - Server Time: 2022-12-24 08:54:42 UTC-06:00

Id      User
21      datamweb (pooya@yahoo.com)
27      Kenji  (kenji@ci.dv)
+----+--------------------------+---------------------+--------+
| ID | Title                    | Updated At          | Active |
+----+--------------------------+---------------------+--------+
| 7  | A great item title       | 2017-11-16 10:35:02 | 1      |
| 8  | Another great item title | 2017-11-16 13:46:54 | 0      |

How do you do it?
https://codeigniter4.github.io/CodeIgniter4/cli/cli_library.html#table

At each stage you may face questions and challenges. Don't worry, try again if you couldn't send a message.

@datamweb datamweb removed the GPG-Signing needed Pull requests that need GPG-Signing label Dec 24, 2022
@ghost
Copy link
Author

ghost commented Dec 24, 2022

Thanks, I think it is better if I create a new branch and close this PR indeed. I'd like to work in the near future on a web backend with the same features (CRUD interface on users) and having everything under the same main branch (develop) will create a lot of confusion and wouldn't be cleanly manageable.
I'll work also on the other suggestions :

  1. output on calling the command without argument : instructions for the user how to use the command
  2. formatting the list output : I avoided to add a table style format to keep code simple, but it would be a nice-looking feature

@datamweb
Copy link
Collaborator

I'd like to work in the near future on a web backend with the same features (CRUD interface on users)

If you mean sending PR to create Admin panel. You should know that Shield is an Authentication and Authorization , not a Admin panel standby system.

So we want to keep it that way.
If you want to use ready-made panels, Bonfire2 is implemented with Shield, so you can use it.

But if you want to help Codeigniter community, you can share it with the community through discussions after finishing the work.

This is my personal opinion, other members may have a different opinion.

@ghost ghost closed this Dec 26, 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. enhancement New feature or request new feature PRs for new features tests needed Pull requests that need tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant