No Code Attached Yet
avatar PhilETaylor
PhilETaylor
28 Jun 2020

Steps to reproduce the issue

Joomla 4.0-dev @ af9be59

php cli/joomla.php user:add

Create a user with p as the password

Expected result

Password doesnt meet configured Joomla User minimum password length and therefore should be rejected

Actual result

User is created.

Screenshot 2020-06-28 at 20 02 50

Screenshot 2020-06-28 at 20 03 23

System information (as much as possible)

Additional comments

avatar PhilETaylor PhilETaylor - open - 28 Jun 2020
avatar joomla-cms-bot joomla-cms-bot - change - 28 Jun 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Jun 2020
avatar PhilETaylor PhilETaylor - change - 28 Jun 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 28 Jun 2020
avatar PhilETaylor PhilETaylor - change - 28 Jun 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 28 Jun 2020
avatar zero-24
zero-24 - comment - 30 Jun 2020

hmm seems that there is no validation at all on that thing right? https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Console/AddUserCommand.php

Does anyone has in mind how that kind of rule validation should be implemented in the CLI context?

avatar PhilETaylor
PhilETaylor - comment - 1 Jul 2020

Does anyone has in mind how that kind of rule validation should be implemented in the CLI context?

Surely it should read from the database the rules that the site admin has set ? The same rules that would be applied by the User Manager in admin.

avatar zero-24
zero-24 - comment - 1 Jul 2020

Yes all of that is done in the form rule. The question was do we have some kind of 'please validate this field' option in the CLI right now as i dont think we should add just another place where repeat the code.

avatar PhilETaylor
PhilETaylor - comment - 1 Jul 2020

There is currently no validation of input in any command that I can see, certainly not any password validation happening - it just takes the provided password and hashes it - its lacking in that area and I have raised other issues about being able to set invalid vars by typo.

The validation would be needed in the ChangeUserPasswordCommand as well as the add user command I guess

avatar mbabker
mbabker - comment - 1 Jul 2020

The question was do we have some kind of 'please validate this field' option in the CLI right now as i dont think we should add just another place where repeat the code.

Too bad Joomla lacks a general purpose data validation API and the closest thing that exists to one is a form rule which means everything has to be in an HTML form for it to be usable.

avatar zero-24
zero-24 - comment - 1 Jul 2020

The question was do we have some kind of 'please validate this field' option in the CLI right now as i dont think we should add just another place where repeat the code.

Too bad Joomla lacks a general purpose data validation API and the closest thing that exists to one is a form rule which means everything has to be in an HTML form for it to be usable.

Ok so we are required to reimplement the rules or do you think there can be a general purpose data validation api based on the form rules maybe?

avatar PhilETaylor PhilETaylor - change - 7 Mar 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-03-07 18:39:28
Closed_By PhilETaylor
Labels Added: No Code Attached Yet
Removed: ?
avatar PhilETaylor PhilETaylor - close - 7 Mar 2022

Add a Comment

Login with GitHub to post a comment