freeside/FS/FS svc_acct.pm,1.109.2.50,1.109.2.51
ivan
ivan at pouncequick.420.am
Sun Feb 13 20:08:49 PST 2005
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory pouncequick:/tmp/cvs-serv16053
Modified Files:
Tag: FREESIDE_1_4_BRANCH
svc_acct.pm
Log Message:
backport duplicate checking fixes to 1.4
Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.109.2.50
retrieving revision 1.109.2.51
diff -u -d -r1.109.2.50 -r1.109.2.51
--- svc_acct.pm 24 Dec 2004 23:35:24 -0000 1.109.2.50
+++ svc_acct.pm 14 Feb 2005 04:08:46 -0000 1.109.2.51
@@ -845,20 +845,19 @@
or die dbh->errstr;
warn "$me acquired svc_acct table lock for duplicate search" if $DEBUG;
- my $svcpart = $self->svcpart;
- my $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
+ my $part_svc = qsearchs('part_svc', { 'svcpart' => $self->svcpart } );
unless ( $part_svc ) {
return 'unknown svcpart '. $self->svcpart;
}
my $global_unique = $conf->config('global_unique-username');
- my @dup_user = grep { $svcpart != $_->svcpart }
+ my @dup_user = grep { !$self->svcnum || $_->svcnum != $self->svcnum }
qsearch( 'svc_acct', { 'username' => $self->username } );
return gettext('username_in_use')
if $global_unique eq 'username' && @dup_user;
- my @dup_userdomain = grep { $svcpart != $_->svcpart }
+ my @dup_userdomain = grep { !$self->svcnum || $_->svcnum != $self->svcnum }
qsearch( 'svc_acct', { 'username' => $self->username,
'domsvc' => $self->domsvc } );
return gettext('username_in_use')
@@ -867,7 +866,7 @@
my @dup_uid;
if ( $part_svc->part_svc_column('uid')->columnflag ne 'F'
&& $self->username !~ /^(toor|(hyla)?fax)$/ ) {
- @dup_uid = grep { $svcpart != $_->svcpart }
+ @dup_uid = grep { !$self->svcnum || $_->svcnum != $self->svcnum }
qsearch( 'svc_acct', { 'uid' => $self->uid } );
} else {
@dup_uid = ();
@@ -928,8 +927,8 @@
my $dup_svcpart = $dup_uid->cust_svc->svcpart;
if ( exists($conflict_user_svcpart{$dup_svcpart})
|| exists($conflict_userdomain_svcpart{$dup_svcpart}) ) {
- return "duplicate uid: conflicts with svcnum". $dup_uid->svcnum.
- "via exportnum ". $conflict_user_svcpart{$dup_svcpart}
+ return "duplicate uid: conflicts with svcnum ". $dup_uid->svcnum.
+ " via exportnum ". $conflict_user_svcpart{$dup_svcpart}
|| $conflict_userdomain_svcpart{$dup_svcpart};
}
}
More information about the freeside-commits
mailing list