From 0181b5c63fbfd5d18acd6a9688edf850d8ff9742 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 6 Dec 2010 02:21:40 +0000 Subject: add a configurable blacklist of login, to complete previous commit --- catdap.yml | 4 ++++ lib/CatDap/Controller/register.pm | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/catdap.yml b/catdap.yml index 55288f6..e981676 100644 --- a/catdap.yml +++ b/catdap.yml @@ -28,6 +28,10 @@ Model::User: host: ldap.mageia.org start_tls: 1 +register: + login_blacklist: + - apache + authentication: default_realm: ldap realms: diff --git a/lib/CatDap/Controller/register.pm b/lib/CatDap/Controller/register.pm index ed3075b..360d7b2 100644 --- a/lib/CatDap/Controller/register.pm +++ b/lib/CatDap/Controller/register.pm @@ -61,6 +61,10 @@ sub check : Local { close($etcpasswd); } + if ( grep /^$username$/, @{${$c->config}{'register'}{'login_blacklist'}}) { + push @errors, $c->loc('Username is not authorized to be used'); + } + if ($c->request->params->{gn} !~ /^\p{IsAlnum}+$/) { push @errors, $c->loc( 'The first name supplied contains illegal characters' -- cgit v1.2.1