[freeside-commits] branch FREESIDE_3_BRANCH updated. 8e84773c2e9107185f0a0cf629cf357d7b8979f5
Mark Wells
mark at 420.am
Thu Jul 11 13:40:20 PDT 2013
The branch, FREESIDE_3_BRANCH has been updated
via 8e84773c2e9107185f0a0cf629cf357d7b8979f5 (commit)
from 88d3c33682585244571ee7622949c3e9213284bf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8e84773c2e9107185f0a0cf629cf357d7b8979f5
Author: Mark Wells <mark at freeside.biz>
Date: Thu Jul 11 13:39:51 2013 -0700
make sqlradius-reexport-group functional
diff --git a/bin/sqlradius-reexport-group b/bin/sqlradius-reexport-group
index a60e471..70a517c 100755
--- a/bin/sqlradius-reexport-group
+++ b/bin/sqlradius-reexport-group
@@ -1,11 +1,16 @@
#!/usr/bin/perl
use FS::UID 'adminsuidsetup';
-use FS::Record qw( qsearch );
+use FS::Record qw( qsearch qsearchs );
use FS::part_export;
use FS::radius_group;
my ($user, $exportnum, $group) = @ARGV;
+die "usage:
+sqlradius-reexport-group <username> <exportnum> <group>
+" unless $user and $exportnum and $group;
+
+
my $dbh = adminsuidsetup($user) or die;
$FS::UID::AutoCommit = 0;
my $radius_group;
@@ -16,6 +21,9 @@ if ( $group =~ /^\d+$/ ) {
}
die "no radius group $group" unless $radius_group;
+my $export = FS::part_export->by_key($exportnum)
+ or die "no export with exportnum '$exportnum'";
+
my @attrs = qsearch('radius_attr', {groupnum => $radius_group->groupnum});
foreach my $attr (@attrs) {
print $attr->attrname."\n";
@@ -23,3 +31,4 @@ foreach my $attr (@attrs) {
die $error if $error;
}
+$dbh->commit;
-----------------------------------------------------------------------
Summary of changes:
bin/sqlradius-reexport-group | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
More information about the freeside-commits
mailing list