[freeside-commits] freeside/FS/FS/part_export sqlradius.pm, 1.26, 1.27
Jeff Finucane,420,,
jeff at wavetail.420.am
Wed Jun 13 09:56:57 PDT 2007
Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail:/tmp/cvs-serv29645
Modified Files:
sqlradius.pm
Log Message:
additional debugging
Index: sqlradius.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/sqlradius.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- sqlradius.pm 8 Jun 2007 17:38:56 -0000 1.26
+++ sqlradius.pm 13 Jun 2007 16:56:55 -0000 1.27
@@ -6,6 +6,7 @@
use FS::part_export;
use FS::svc_acct;
use FS::export_svc;
+use Carp qw( cluck );
@ISA = qw(FS::part_export);
@@ -106,6 +107,9 @@
}
my @groups = $svc_acct->radius_groups;
if ( @groups ) {
+ cluck localtime(). ": queuing usergroup_insert for ". $svc_acct->svcnum.
+ " (". $self->export_username($svc_acct). " with ". join(", ", @groups)
+ if $DEBUG;
my $err_or_queue = $self->sqlradius_queue(
$svc_acct->svcnum, 'usergroup_insert',
$self->export_username($svc_acct), @groups );
@@ -384,7 +388,12 @@
foreach my $group ( @groups ) {
$s_sth->execute( $username, $group ) or die $s_sth->errstr;
- next if $s_sth->fetchrow_arrayref->[0];
+ if ($s_sth->fetchrow_arrayref->[0]) {
+ warn localtime() . ": sqlradius_usergroup_insert attempted to reinsert " .
+ "$group for $username\n"
+ if $DEBUG;
+ next;
+ }
$sth->execute( $username, $group )
or die "can't insert into groupname table: ". $sth->errstr;
}
@@ -476,6 +485,9 @@
}
if ( @newgroups ) {
+ cluck localtime(). ": queuing usergroup_insert for $svcnum ($username) ".
+ "with ". join(", ", @newgroups)
+ if $DEBUG;
my $err_or_queue = $self->sqlradius_queue( $svcnum, 'usergroup_insert',
$username, @newgroups );
return $err_or_queue
More information about the freeside-commits
mailing list