>
> *Question:*
> Would it be worth considering an actual validator for username and 
> user-like fields.
>
>
> *IS_LIKE_GOOGLE*
> IS_LIKE_GOOGLE validator enforces a username policy similar to Google 
> Accounts (as of 2012),
> min 6 - 30 characters, only letters (a-z) and numbers (0-9), and periods, 
> can't start or end with a period,
> can't have consecutive periods, and of course can't exist in database.
>
> Note: if an optional
> IS_LIKE_GOOGLE(db, 'table.fieldname') - then any user created user type 
> field would be validated,
>

Not a bad idea, but I would make it more generic and configurable, much 
like the IS_STRONG validator for passwords. Maybe something like 
IS_USERNAME, and have it take several arguments to configure the various 
validation options (including ability to provide a custom bad words list, 
and custom error messages for each potential problem).

Anthony

-- 



Reply via email to