diff options
author | mark <mark> | 2011-11-23 18:42:50 +0000 |
---|---|---|
committer | mark <mark> | 2011-11-23 18:42:50 +0000 |
commit | d838063ab25f047e88c3e5ae16f77fc4f3481ce9 (patch) | |
tree | e4f533d73a30b62522c4e50df9c142a10737e5d2 /FS/bin | |
parent | d0008add75bbb6e2ec49e6d40f28965eac0bcfb6 (diff) |
RADIUS group attributes, #15017
Diffstat (limited to 'FS/bin')
-rwxr-xr-x | FS/bin/freeside-sqlradius-reset | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/FS/bin/freeside-sqlradius-reset b/FS/bin/freeside-sqlradius-reset index 8ecd39d..b04c640 100755 --- a/FS/bin/freeside-sqlradius-reset +++ b/FS/bin/freeside-sqlradius-reset @@ -35,7 +35,10 @@ unless ( $opt_n ) { map { $export->option($_) } qw( datasrc username password ) ) or die $DBI::errstr; my $usergroup = $export->option('usergroup') || 'usergroup'; - for my $table (qw( radcheck radreply ), $usergroup) { + my @attr_tables; + @attr_tables = qw( radgroupcheck radgroupreply ) + if $export->option('export_attrs'); + for my $table (qw( radcheck radreply ), $usergroup, @attr_tables) { my $sth = $icradius_dbh->prepare("DELETE FROM $table"); $sth->execute or die "Can't reset $table table: ". $sth->errstr; } @@ -47,6 +50,9 @@ use FS::svc_Common; $FS::svc_Common::overlimit_missing_cust_svc_nonfatal_kludge = 1; $FS::svc_Common::overlimit_missing_cust_svc_nonfatal_kludge = 1; +# this is the same across all exports, for now +my @radius_attrs = qsearch('radius_attr', {}); + foreach my $export ( @exports ) { #my @svcparts = map { $_->svcpart } $export->export_svc; @@ -85,6 +91,13 @@ foreach my $export ( @exports ) { die $error if $error; } + + if ( $export->option('export_attrs') ) { + foreach my $attr (@radius_attrs) { + my $error = $export->export_attr_insert($attr); + die $error if $error; + } + } } sub usage { |