aspose file tools*
The moose likes JForum and the fly likes Registration : UserName validation with a regexp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "Registration : UserName validation with a regexp" Watch "Registration : UserName validation with a regexp" New topic
Author

Registration : UserName validation with a regexp

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi all,

I'm trying to force new users to respect a naming convention in their usernames.

After some look in the code, it seems that jforum don't make any verifications on the username field.

Is it possible to activate it by a parameter, or may i modify the code ?
I plan to test the username with a server-side regexp match.

Thank you by advance,

Edlefou.

[originally posted on jforum.net by edlefou]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
A no-code change way (but not too secure) to do this would be add in some Javascript validation to the user registration template that would check the supplied user name.

Of course, a hacker could get around this fairly easily, so the more secure way would be to modify the UserAction.insertSave() method to do your checks.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi,

Thank you for these usefull informations, i have modified the UserAction.insertSave() method.

Edlefou
[originally posted on jforum.net by edlefou]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Registration : UserName validation with a regexp