From 8f81a29fe1ac874e7fdad0f651297e0b340a663f Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Sep 2003 15:01:42 +0000 Subject: [PATCH] no duplicate usernames --- FS/FS/agent.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.20.1