Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: @ in screenname
I have a requirement that users will have screennames which may be may not be their email addresses. This means screenName could be either testusername or testusername@test.com.
As I see, It is not possible to insert a @ sign in the screenName. I have also configured to use
The problem seems to be the following code in class UserLocalServiceImpl
How can I bypass it?
Are there any other options available?
Thanks,
Sultee
As I see, It is not possible to insert a @ sign in the screenName. I have also configured to use
users.screen.name.validator=com.liferay.portal.security.auth.LiberalScreenNameValidatorThe problem seems to be the following code in class UserLocalServiceImpl
for (char c : screenName.toCharArray()) {
if ((!Validator.isChar(c)) && (!Validator.isDigit(c)) &&
(c != CharPool.DASH) && (c != CharPool.PERIOD) &&
(c != CharPool.UNDERLINE)) {
throw new UserScreenNameException();
}
}How can I bypass it?
Are there any other options available?
Thanks,
Sultee
I think you need to override validator class and you can bypass this @ validation.
or else you can override UserLocalServiceImpl class and bypass to calling validator class but this is not good practice.
or else you can override UserLocalServiceImpl class and bypass to calling validator class but this is not good practice.
I created my custom validator but the concerned code comes after the validator class has done its job.
Hi.. I am also facing the same problem... In my case I need to allow space in my screenName.
Even if we specify the LiberalScreenNameValidator class, the remaining code is throwing the exception.
@Jignesh How can we override the validator class in a plugin portlet environment ?
Even if we specify the LiberalScreenNameValidator class, the remaining code is throwing the exception.
@Jignesh How can we override the validator class in a plugin portlet environment ?