Password regex and warning not working?

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
7/1/2015 7:29:40 AM
Gravatar
Total Posts 115

Password regex and warning not working?

I think there's a problem with password regular expressions, or perhaps I just cannot work out the right syntax.

I cannot find any regex that passes (and I've tried on the demo site). No matter what I enter into the site settings for the "Password Strength Regular Expression" we get this markup on the page:

<span data-val-controltovalidate="ctl00_mainContent_RegisterUser_CreateUserStepContainer_Password" data-val-errormessage="Please make Password more complex." data-val-display="None" data-val-validationGroup="profile" id="ctl00_mainContent_RegisterUser_CreateUserStepContainer_PasswordRegex" class="txterror" data-val="true" data-val-evaluationfunction="RegularExpressionValidatorEvaluateIsValid" style="display:none;"></span>
(which is obviously missing its data-val-validationexpression="blah", and is also ignoring our configured "Password Strength Error Message").

The presence of something in the site setting does make this regex validator appear, but it's not working right. Have I missed something?

7/3/2015 3:37:18 PM
Gravatar
Total Posts 115

Re: Password regex and warning not working?

I've had a quick poke about in the code and think I can give you the fixes for this issue.

In Register.aspx.cs...

RegularExpressionValidator passwordRegex

= (RegularExpressionValidator)CreateUserWizardStep1.ContentTemplateContainer.FindControl("PasswordRegex");

// CF bug fix part 1 https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=13155~1

if (siteSettings.PasswordRegexWarning.Length > 0)

{

passwordRegex.ErrorMessage = siteSettings.PasswordRegexWarning;

}

else

{

passwordRegex.ErrorMessage = Resource.RegisterPasswordRegexWarning;

}

//end fix

AND (further down)

if (Membership.Provider.PasswordStrengthRegularExpression.Length == 0)

{

passwordRegex.Visible = false;

}

//CF bug fix part 2 https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=13155~1

else

{

passwordRegex.ValidationExpression = Membership.Provider.PasswordStrengthRegularExpression;

}

//end fix

 

 

7/4/2015 11:59:26 AM
Gravatar
Total Posts 18444

Re: Password regex and warning not working?

Thanks for the bug report and fix. This is now fixed in the source code repository.

You must sign in to post in the forums. This thread is closed to new posts.