[freeside-commits] branch master updated. 1157c6c1c52fd85c85ed97882d8f0d52bc693eeb

Mark Wells mark at 420.am
Wed Jul 3 10:57:04 PDT 2013


The branch, master has been updated
       via  1157c6c1c52fd85c85ed97882d8f0d52bc693eeb (commit)
      from  3d0a1bb06b895c5be6e3f0517d355442a6b1e125 (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 1157c6c1c52fd85c85ed97882d8f0d52bc693eeb
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Jul 3 10:56:48 2013 -0700

    sqlradius-reexport-group tool

diff --git a/bin/sqlradius-reexport-group b/bin/sqlradius-reexport-group
new file mode 100644
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 100644 bin/sqlradius-reexport-group




More information about the freeside-commits mailing list