Can username validation in exoadmin UI be configurable in EPP 5 / JPP 6?
Issue
-
The issue occurs on the Groups Management tab of the "Users and Groups Management" portlet when adding a user to a group. In one case the username is composed of numeric characters. When clicking Save on the screen, a validation warning dialog appears with the following message:
'The field "User Name" can only contain alpha, digit, comma, dash characters. The first and last character must be a letter.'
Further investigation shows that hard coded regular expressions are used for validations. For example, the following code is in the org.exoplatform.organization.webui.component.UIGroupMembershipForm class:
addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME, null)
.addValidator(MandatoryValidator.class)
.addValidator(ExpressionValidator.class,
"^\\p{L}[\\p{L}\\d._\\-,]+$", "UIGroupMembershipForm.msg.Invalid-char"
)
);
Is it possibly to make the validation expression configurable?
Environment
- JBoss Enterprise Portal Platform(EPP)
- 5.0.x
- 5.1.x
- 5.2.0
- Red Hat JBoss Portal (JPP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.