From: ivan Date: Tue, 30 Sep 2003 15:01:46 +0000 (+0000) Subject: no duplicate usernames X-Git-Tag: NET_WHOIS_RAW_0_31~357 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=c1dfeada58be61ec33bb1cfb80a2cff73f7c9a3c;hp=021e1ac77366fb0765cb364af0c09f5f2df92266 no duplicate usernames --- diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index bcba602cc..2f70d654d 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -125,6 +125,9 @@ sub check { $error = $self->ut_alphan('username'); return $error if $error; if ( length($self->username) ) { + my $conflict = qsearchs('agent', { 'username' => $self->username } ); + return 'duplicate agent username (with '. $conflict->agent. ')' + if $conflict; $error = $self->ut_text('password'); # ut_text... arbitrary choice } else { $self->_password(''); @@ -165,7 +168,7 @@ sub pkgpart_hashref { =head1 VERSION -$Id: agent.pm,v 1.5 2003-09-29 05:51:50 ivan Exp $ +$Id: agent.pm,v 1.6 2003-09-30 15:01:46 ivan Exp $ =head1 BUGS