From: ivan Date: Tue, 30 Sep 2003 15:01:42 +0000 (+0000) Subject: no duplicate usernames X-Git-Tag: freeside_1_4_2beta1~466 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=8f81a29fe1ac874e7fdad0f651297e0b340a663f;p=freeside.git no duplicate usernames --- diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index 3f1495ae8..9b7492d07 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(''); @@ -166,7 +169,7 @@ sub pkgpart_hashref { =head1 VERSION -$Id: agent.pm,v 1.3.4.1 2003-09-29 05:51:48 ivan Exp $ +$Id: agent.pm,v 1.3.4.2 2003-09-30 15:01:42 ivan Exp $ =head1 BUGS