Custom username validator should not be enabled when user can't change the username

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/9/2012 8:02:54 AM
Gravatar
Total Posts 192

Custom username validator should not be enabled when user can't change the username

 Hi.

I had a custom username expression set in one of my portals, but I have run into an issue with it.

it works correctly when users try to signup, but when a user tries to save his profile without changing anything, the custom expression doesn't allow the user to save, even if the user has not (and can not) change the username.

I don't know what is the cause of this issue, but a reasonable fix would be not to enable this regular expression validator if the user is not allowed to change the username. though in  secure/userprofile.aspx.cs around line 571, this:

if (WebConfigSettings.UserNameValidationExpression.Length > 0 && siteSettings.AllowUserFullNameChange)

should be used instead of:

if (WebConfigSettings.UserNameValidationExpression.Length > 0)

thanks.

 

 

(the expression is :[\s|\p{IsArabic}]+

I'm not familiar with javascript validation. but when rendered to the browser the backslashes are rendered escaped, which is [\\s|\\p{IsArabic}]+   . if I change the live code, it works in the userprofile page, but I wonder how does the same code works correctly in user registeration page without trouble making.

enabling the txtName control in userprofile.aspx also didn't help. so I thought it's better to disable the regular expression validator when user is not allowed to change the username)

4/9/2012 8:15:29 AM
Gravatar
Total Posts 18439

Re: Custom username validator should not be enabled when user can't change the username

I will make this change.

Best,

Joe

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