[freeside-commits] freeside/FS/FS part_svc.pm,1.40,1.41
Erik Levinson
levinse at wavetail.420.am
Tue Jun 28 21:52:22 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv26539/FS/FS
Modified Files:
part_svc.pm
Log Message:
re-write RADIUS groups, RT13274
Index: part_svc.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_svc.pm,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -w -d -r1.40 -r1.41
--- part_svc.pm 29 Jun 2011 03:51:11 -0000 1.40
+++ part_svc.pm 29 Jun 2011 04:52:20 -0000 1.41
@@ -875,13 +875,21 @@
next if $col->columnvalue =~ /^[\d,]+$/ || !$col->columnvalue;
my @groupnames = split(',',$col->columnvalue);
my @groupnums;
+ my $error = '';
foreach my $groupname ( @groupnames ) {
- my $g = qsearchs('radius_group', { 'groupname' => $groupname } )
- || die "invalid group ".$groupname;
+ my $g = qsearchs('radius_group', { 'groupname' => $groupname } );
+ unless ( $g ) {
+ $g = new FS::radius_group {
+ 'groupname' => $groupname,
+ 'description' => $groupname,
+ };
+ $error = $g->insert;
+ die $error if $error;
+ }
push @groupnums, $g->groupnum;
}
$col->columnvalue(join(',', at groupnums));
- my $error = $col->replace;
+ $error = $col->replace;
die $error if $error;
}
More information about the freeside-commits
mailing list