[freeside-commits] branch FREESIDE_3_BRANCH updated. 17e015204a59378ef243e685b5dd849835ee1b4f
Mark Wells
mark at 420.am
Wed Jul 3 10:57:02 PDT 2013
The branch, FREESIDE_3_BRANCH has been updated
via 17e015204a59378ef243e685b5dd849835ee1b4f (commit)
from 2a95a4cd4d79dcf1450e8ff3ee63b82c1416cc8d (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 17e015204a59378ef243e685b5dd849835ee1b4f
Author: Mark Wells <mark at freeside.biz>
Date: Wed Jul 3 10:53:51 2013 -0700
sqlradius-reexport-group tool
diff --git a/bin/sqlradius-reexport-group b/bin/sqlradius-reexport-group
new file mode 100755
index 0000000..a60e471
--- /dev/null
+++ b/bin/sqlradius-reexport-group
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+use FS::UID 'adminsuidsetup';
+use FS::Record qw( qsearch );
+use FS::part_export;
+use FS::radius_group;
+
+my ($user, $exportnum, $group) = @ARGV;
+my $dbh = adminsuidsetup($user) or die;
+$FS::UID::AutoCommit = 0;
+my $radius_group;
+if ( $group =~ /^\d+$/ ) {
+ $radius_group = FS::radius_group->by_key($group);
+} else {
+ $radius_group = qsearchs('radius_group',{'groupname' => $group});
+}
+die "no radius group $group" unless $radius_group;
+
+my @attrs = qsearch('radius_attr', {groupnum => $radius_group->groupnum});
+foreach my $attr (@attrs) {
+ print $attr->attrname."\n";
+ my $error = $export->export_attr_insert($attr);
+ die $error if $error;
+}
+
-----------------------------------------------------------------------
Summary of changes:
bin/sqlradius-reexport-group | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
create mode 100755 bin/sqlradius-reexport-group
More information about the freeside-commits
mailing list