re-write RADIUS groups, RT13274
authorlevinse <levinse>
Fri, 24 Jun 2011 02:48:44 +0000 (02:48 +0000)
committerlevinse <levinse>
Fri, 24 Jun 2011 02:48:44 +0000 (02:48 +0000)
FS/FS/svc_acct.pm

index 9a2f009..e8c797a 100644 (file)
@@ -2563,7 +2563,13 @@ sub radius_groups {
       unless ref($self->usergroup) eq 'ARRAY';
     #when provisioning records, export callback runs in svc_Common.pm before
     #radius_usergroup records can be inserted...
       unless ref($self->usergroup) eq 'ARRAY';
     #when provisioning records, export callback runs in svc_Common.pm before
     #radius_usergroup records can be inserted...
-    @{$self->usergroup};
+    my $groups = join(',',@{$self->usergroup});
+    my @groups;
+    return @groups unless length($groups);
+    @groups = qsearch({ 'table'         => 'radius_group',
+                           'extra_sql'     => "where groupnum in ($groups)",
+                        });
+    map { $_->groupname } @groups;
   } else {
      my $format = shift || '';
      my @groups = qsearch({ 'table'         => 'radius_usergroup',
   } else {
      my $format = shift || '';
      my @groups = qsearch({ 'table'         => 'radius_usergroup',