[Mageia-sysadm] [164] add a configurable blacklist of login, to complete previous commit

root at mageia.org root at mageia.org
Mon Dec 6 03:21:40 CET 2010


Revision: 164
Author:   misc
Date:     2010-12-06 03:21:40 +0100 (Mon, 06 Dec 2010)
Log Message:
-----------
add a configurable blacklist of login, to complete previous commit

Modified Paths:
--------------
    identity/CatDap/trunk/catdap.yml
    identity/CatDap/trunk/lib/CatDap/Controller/register.pm

Modified: identity/CatDap/trunk/catdap.yml
===================================================================
--- identity/CatDap/trunk/catdap.yml	2010-12-06 01:15:53 UTC (rev 163)
+++ identity/CatDap/trunk/catdap.yml	2010-12-06 02:21:40 UTC (rev 164)
@@ -28,6 +28,10 @@
         host: ldap.mageia.org
         start_tls: 1
 
+register:
+        login_blacklist:
+                - apache
+
 authentication:
         default_realm: ldap
         realms:

Modified: identity/CatDap/trunk/lib/CatDap/Controller/register.pm
===================================================================
--- identity/CatDap/trunk/lib/CatDap/Controller/register.pm	2010-12-06 01:15:53 UTC (rev 163)
+++ identity/CatDap/trunk/lib/CatDap/Controller/register.pm	2010-12-06 02:21:40 UTC (rev 164)
@@ -61,6 +61,10 @@
         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'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20101206/f5efab81/attachment-0001.html>


More information about the Mageia-sysadm mailing list