From c1dfeada58be61ec33bb1cfb80a2cff73f7c9a3c Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Sep 2003 15:01:46 +0000 Subject: [PATCH 1/1] 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 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 -- 2.11.0