summaryrefslogtreecommitdiff
path: root/FS/FS/agent.pm
diff options
context:
space:
mode:
authorivan <ivan>2003-09-30 15:01:46 +0000
committerivan <ivan>2003-09-30 15:01:46 +0000
commitc1dfeada58be61ec33bb1cfb80a2cff73f7c9a3c (patch)
tree8b57a6c7d9415c4a15437c6d01a61f4bbea10e02 /FS/FS/agent.pm
parent021e1ac77366fb0765cb364af0c09f5f2df92266 (diff)
no duplicate usernames
Diffstat (limited to 'FS/FS/agent.pm')
-rw-r--r--FS/FS/agent.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm
index bcba602..2f70d65 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