[SOLVED] Field password cutsom validation fails

13 years 10 months ago #135696 by netzagentin
I try to set a custom regex to validate the field password at user management. I tried several regex but have allways the same problem. Valid passwords return the error message of the cb field password.

I'd like to validate the password as following:

min 6 Char AND min 1 lowercase Letter AND min 1 uppercase Letter AND 1 digit.

I tried this regex:

/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])$/

As I searched in forums I could not find an answer to the problem but it seemed to be one in the past.

I would be pleased of any help. Thanks a lot.

I use cb 1.2.2 and SBSubs and am a Doc subscriber and SBSubs subscriber

netzagentin

Post edited by: krileon, at: 2010/08/04 16:34

Please Log in to join the conversation.

13 years 10 months ago #135782 by krileon
Replied by krileon on topic Re:Field password cutsom validation fails
Please try the following.

[code:1]
/\A(?=[-_a-zA-Z0-9]*?[A-Z])(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])[-_a-zA-Z0-9]{6,}\z/
[/code:1]

The above will perform the following.

[code:1]
Tests if the input consists of 6 or more letters, digits, underscores and hyphens.
The input must contain at least one upper case letter, one lower case letter and one digit.
[/code:1]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 10 months ago #135858 by netzagentin
Replied by netzagentin on topic Re:Field password cutsom validation fails
Hi krileon

thanks for your fast answer.

I tried your regex but got the same failure.

f.e. I tried to set a new password Q12wer and got the errormessage. But this password should be accepted. I tried it as a member on frontend and as superadmin in backend

As I have seen there is the second option in the drop down at authorized input which offers a regex like 'at least 6 chars, 1 a-z, 1A-Z, 1 0-9, 1 special

I just need this regex without the part 1 special.
So maybe it is possible to set this regex in core? And which file is it?

First I like to test again the custom regex. Maybe the one which is set in the second line? Could you give me the code of it?

Is there a dependency on some settings? Or do I need to change something in general joomla config?

regards Netzagentin

Please Log in to join the conversation.

13 years 10 months ago #136039 by krileon
Replied by krileon on topic Re:Field password cutsom validation fails

So maybe it is possible to set this regex in core? And which file is it?

[code:1]
/^(?=.*\d)(?=.*(\W|_))(?=.*[a-z])(?=.*[A-Z]).{6,255}$/
[/code:1]
The above is the exact regex used by that parameter. Sorry don't know what further to advise. I recommend reviewing the regex resources found here .


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 10 months ago #136052 by netzagentin
Replied by netzagentin on topic Re:Field password cutsom validation fails
Hi Krileon

I choosed the second possibility to test the validation.

But it also don't work. The validation only works with the first one: any string (/*.*/)

So I think it is not the regex, but some other issue.

The second thing is that I got a warning when change the parameter of the field entry validation dropdown. This is new. The first time I tried to set a custom regex, I got no such messages.

The message was:

moscomprofilerFields::store failed: CBSQLupgrader::createTableof Table jos_users failed with SQL error: Table 'jos_users' already exists SQL=CREATE TABLE `jos_users` (\n `password` varchar(100) NOT NULL DEFAULT ''\n ) ENGINE=MyISAM Table 'jos_users' already exists SQL=CREATE TABLE `jos_users` (\n `password` varchar(100) NOT NULL DEFAULT ''\n ) ENGINE=MyISAM

Even when I press 'ok' the settings seemed to be changed. With the original setting 'any string' now I can change the password to any 6 char string.

Do you have any idea what the problem in my case is?

If you need access to the joomla installation I will pm it to you.

Thanks for your help.

netzagentin

Please Log in to join the conversation.

13 years 9 months ago #136185 by krileon
Replied by krileon on topic Re:Field password cutsom validation fails
Never seen such an error. It's possible you've a bad installation. Did you upgrade to CB 1.2.2 or was it a fresh install? Please run CB Tools to ensure there are no errors and if they're fixable by CB.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.191 seconds

Facebook Twitter LinkedIn