aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CatDap
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2012-07-06 16:42:13 +0000
committerNicolas Vigier <boklm@mageia.org>2012-07-06 16:42:13 +0000
commitac112f8b9454b5e4ec4bac614358318ef7c3b664 (patch)
tree21a234b82a849215650e39e25abea4dd5794a1af /lib/CatDap
parentdc27004f85a8018facfbc0ae659f0f943bc191a6 (diff)
downloadidentity-ac112f8b9454b5e4ec4bac614358318ef7c3b664.tar
identity-ac112f8b9454b5e4ec4bac614358318ef7c3b664.tar.gz
identity-ac112f8b9454b5e4ec4bac614358318ef7c3b664.tar.bz2
identity-ac112f8b9454b5e4ec4bac614358318ef7c3b664.tar.xz
identity-ac112f8b9454b5e4ec4bac614358318ef7c3b664.zip
add option to change the regex used to validate username
Diffstat (limited to 'lib/CatDap')
-rw-r--r--lib/CatDap/Controller/register.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CatDap/Controller/register.pm b/lib/CatDap/Controller/register.pm
index 1aef176..2ef3fce 100644
--- a/lib/CatDap/Controller/register.pm
+++ b/lib/CatDap/Controller/register.pm
@@ -39,7 +39,8 @@ sub check : Local {
my @errors;
$c->stash(errors => []);
# Check username, start with letter, followed by letters or numbers
- if ($username !~ /^[a-z][a-z0-9_-]*$/) {
+ my $login_regex = ${$c->config}{'register'}{'login_regex'};
+ if ($username !~ /$login_regex/) {
push @errors, $c->loc('Invalid username');
}
my $email = $c->request->params->{mail1};