[6.0] add cli usergroup id support#45433
[6.0] add cli usergroup id support#45433tecpromotion wants to merge 9 commits intojoomla:6.0-devfrom
Conversation
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
|
@tecpromotion Just a small nudge to get this over the line, then we can get tests arranged. |
|
I have tested this item ✅ successfully on 9dcc28b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45433. |
|
I'm wondering that This code was introduced with PR 45143. Update: Fix is already in work:
|
Summary of Changes
This PR extends the user:add CLI command to support assigning user groups either by name (as before) or by numeric ID (new).
The --usergroup option now accepts:
• a group name (e.g. "Super Users")
• a group ID (e.g. 8)
• or a comma-separated list of mixed values (e.g. "2,8,Registered")
Each value is internally checked:
• If it’s numeric and matches an existing ID → accepted
• If it matches an existing group name → accepted
• Otherwise → error
This provides a more flexible developer and automation experience, especially when working with provisioning tools.
Example CLI calls (all valid now):
php cli/joomla.php user:add \ --username="cliadmin" \ --password="Sup3rS3cur3_P4ssw0rt!" \ --email="stefan.wendhausen@community.joomla.org" \ --name="CLI User" \ --usergroup="8"Testing Instructions
php cli/joomla.php user:add --username=test1 --password=abc123 --email=test1@community.joomla.org --name="Test User" --usergroup="8"php cli/joomla.php user:add --username=test2 --password=abc123 --email=test2@community.joomla.org --name="Test User" --usergroup="Super Users"php cli/joomla.php user:add --username=test3 --password=abc123 --email=test3@community.joomla.org --name="Test User" --usergroup="2,3"php cli/joomla.php user:add --username=test4 --password=abc123 --email=test4@community.joomla.org --name="Test User" --usergroup="Registered,Author,8"Actual result BEFORE applying this Pull Request
The parameter
--usergroupdoes not work with a user group ID.Expected result AFTER applying this Pull Request
An ID for a user group is accepted and the user is created.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed