Gossamer Forum
Home : Products : Others : Gossamer Community :

Username and password length

Quote Reply
Username and password length
How do I force the length and detail on the username and password?
i.e. username be say 6-10 char is length
Password contain numbers and letters

Thanks,

Nathan
Quote Reply
Re: [catlovette] Username and password length In reply to
It's in community.conf for username;
e.g.
'signup_username_regex' => '^[A-Za-z0-9\_-]{3,10}$',

What about the password? Is there anywhere where I can apply a regex? Is it hard coded in the perl?
Quote Reply
Re: [catlovette] Username and password length In reply to
Aaaaaaaaaaaarrrrrrrrrrrrrrrrrr Frown
Quote Reply
Re: [catlovette] Username and password length In reply to
In Reply To:
Aaaaaaaaaaaarrrrrrrrrrrrrrrrrr Frown

Hey calm down Wink

Here what we have in: ../lib/Community/User.pm around line 237

Code:
sub cuser_pw_validate_error {
# -------------------------------------------------------------------
my $password = shift;
$password =~ /^\s*$/ and return 'SIGNUP_PASSWORD_MISSING';
length($password) < 4 and return 'SIGNUP_PASSWORD_TOOSHORT';
return '';
}

These sholud do the job for you Tongue

zaaron

---------
GetLokal Reviews
Quote Reply
Re: [zaaron] Username and password length In reply to
Thanks zaaron

I'll give this a try.
Quote Reply
Re: [catlovette] Username and password length In reply to
Sorted