diff options
author | levinse <levinse> | 2011-06-29 03:51:11 +0000 |
---|---|---|
committer | levinse <levinse> | 2011-06-29 03:51:11 +0000 |
commit | 9324c64e784a866c4d615773c8ce5970cc0d6ed8 (patch) | |
tree | 122470b7257e1fbef756501fd3a02890d22912c0 /FS | |
parent | 44f5aa6d692b460cc34bc44810fab8e4c3e37b68 (diff) |
re-write RADIUS groups, RT13274
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Upgrade.pm | 1 | ||||
-rw-r--r-- | FS/FS/part_svc.pm | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm index 787ee24bb..ca6036e5f 100644 --- a/FS/FS/Upgrade.pm +++ b/FS/FS/Upgrade.pm @@ -193,6 +193,7 @@ sub upgrade_data { # migrate to radius_group and groupnum instead of groupname 'radius_usergroup' => [], + 'part_svc' => [], ; diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index c4881c706..d3fe3b6cc 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -867,6 +867,26 @@ sub process_bulk_cust_svc { } +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(',',@groupnums)); + my $error = $col->replace; + die $error if $error; + } + +} + =head1 BUGS Delete is unimplemented. |