projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
when searching locaitons, don't search historic locations by default, RT#73412
[freeside.git]
/
FS
/
bin
/
freeside-sqlradius-reset
diff --git
a/FS/bin/freeside-sqlradius-reset
b/FS/bin/freeside-sqlradius-reset
index
c8da60a
..
b04c640
100755
(executable)
--- a/
FS/bin/freeside-sqlradius-reset
+++ b/
FS/bin/freeside-sqlradius-reset
@@
-19,7
+19,7
@@
adminsuidsetup $user;
my @exports = ();
if ( @ARGV ) {
foreach my $exportnum ( @ARGV ) {
my @exports = ();
if ( @ARGV ) {
foreach my $exportnum ( @ARGV ) {
- foreach my $exporttype (qw( sqlradius sqlradius_withdomain
o
hone_sqlradius broadband_sqlradius )) {
+ foreach my $exporttype (qw( sqlradius sqlradius_withdomain
p
hone_sqlradius broadband_sqlradius )) {
push @exports, qsearch('part_export', { exportnum => $exportnum,
exporttype => $exporttype, } );
}
push @exports, qsearch('part_export', { exportnum => $exportnum,
exporttype => $exporttype, } );
}
@@
-35,7
+35,10
@@
unless ( $opt_n ) {
map { $export->option($_) } qw( datasrc username password )
) or die $DBI::errstr;
my $usergroup = $export->option('usergroup') || 'usergroup';
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;
}
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;
$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;
foreach my $export ( @exports ) {
#my @svcparts = map { $_->svcpart } $export->export_svc;
@@
-85,6
+91,13
@@
foreach my $export ( @exports ) {
die $error if $error;
}
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 {
}
sub usage {