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;
}
$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;
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 {