Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

UserNameValidationRegex

Summary

Settings regarding custom validation of user names

Usage

UserNameValidationRegex[]=

Description

This setting is available since eZ Publish 4.1. It is used for custom validation of user names which will affect new users, and existing users when they edit their credentials.

Examples

Example 1

UserNameValidationRegex[sw]=/^\s/
UserNameValidationErrorText[sw]=The user name cannot start with a white-space.

More examples

#UserNameValidationRegex[ew]=/\s$/
#UserNameValidationErrorText[ew]=The user name cannot end with a white-space.
#UserNameValidationRegex[rw]=/\s+/
#UserNameValidationErrorText[rw]=The user name cannot contain repeated white-space.
#UserNameValidationRegex[lb]=/\n|\r/
#UserNameValidationErrorText[lb]=The user name cannot contain line breaks.
#UserNameValidationRegex[t]=/\t/
#UserNameValidationErrorText[t]=The user name cannot contain tabs.

Alternative example only allowing 'word' characters

#UserNameValidationRegex[w]=/\W/
#UserNameValidationErrorText[w]=The user name can only contain a-z, digits or underline.
# Or
#UserNameValidationRegex[wh]=/[^A-Za-z0-9_-]/
#UserNameValidationErrorText[wh]=The user name can only contain a-z, digits, underline or hyphen.
 
# While testing add this at the end, just remember to remove it when your done.
#UserNameValidationRegex[test]=/\w/
#UserNameValidationErrorText[test]=The username seems to be ok!

Ester Heylen (24/11/2009 10:54 am)

Geir Arne Waaler (17/12/2010 12:48 pm)

Ester Heylen, Geir Arne Waaler


Comments

There are no comments.