mutex the bill and collect functions per-customer
[freeside.git] / FS / FS / agent.pm
index 3f1495a..9b7492d 100644 (file)
@@ -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