Modified: identity/CatDap/trunk/lib/CatDap/Controller/register.pm
===================================================================
--- identity/CatDap/trunk/lib/CatDap/Controller/register.pm 2010-11-27 19:49:21 UTC (rev 162)
+++ identity/CatDap/trunk/lib/CatDap/Controller/register.pm 2010-12-06 01:15:53 UTC (rev 163)
@@ -51,6 +51,16 @@
if (! $c->validate_captcha($c->req->param('validate'))){
push @errors, $c->loc('Incorrect validation text, please try again');
}
+
+ if ( ! open( my $etcpasswd, "/etc/passwd")) {
+ push @errors, $c->loc('Cannot check /etc/passwd, please warn system administrators');
+ } else {
+ if ( grep { /^$username:/ } <$etcpasswd> ) {
+ push @errors, $c->loc('Invalid username, already used by system');
+ }
+ close($etcpasswd);
+ }
+
if ($c->request->params->{gn} !~ /^\p{IsAlnum}+$/) {
push @errors, $c->loc(
'The first name supplied contains illegal characters'