[freeside-commits] freeside/FS/FS part_svc.pm, 1.39, 1.40 Upgrade.pm, 1.49, 1.50
Erik Levinson
levinse at wavetail.420.am
Tue Jun 28 20:51:13 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv21472/FS/FS
Modified Files:
part_svc.pm Upgrade.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.39
retrieving revision 1.40
diff -u -w -d -r1.39 -r1.40
--- part_svc.pm 28 Jun 2011 22:36:20 -0000 1.39
+++ part_svc.pm 29 Jun 2011 03:51:11 -0000 1.40
@@ -867,6 +867,26 @@
}
+sub _upgrade_data { #class method
+ my ($class, %opts) = @_;
+
+ my @part_svc_column = qsearch('part_svc_column', { 'columnname' => 'usergroup' });
+ foreach my $col ( @part_svc_column ) {
+ next if $col->columnvalue =~ /^[\d,]+$/ || !$col->columnvalue;
+ my @groupnames = split(',',$col->columnvalue);
+ my @groupnums;
+ foreach my $groupname ( @groupnames ) {
+ my $g = qsearchs('radius_group', { 'groupname' => $groupname } )
+ || die "invalid group ".$groupname;
+ push @groupnums, $g->groupnum;
+ }
+ $col->columnvalue(join(',', at groupnums));
+ my $error = $col->replace;
+ die $error if $error;
+ }
+
+}
+
=head1 BUGS
Delete is unimplemented.
Index: Upgrade.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Upgrade.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -w -d -r1.49 -r1.50
--- Upgrade.pm 21 Jun 2011 01:04:55 -0000 1.49
+++ Upgrade.pm 29 Jun 2011 03:51:11 -0000 1.50
@@ -193,6 +193,7 @@
# migrate to radius_group and groupnum instead of groupname
'radius_usergroup' => [],
+ 'part_svc' => [],
;
More information about the freeside-commits
mailing list