use Carp qw( cluck );
use NEXT;
use Net::OpenSSH;
+use FS::DBI;
@ISA = qw(FS::part_export);
@EXPORT_OK = qw( sqlradius_connect );
type => 'select',
options => [qw( usergroup radusergroup ) ],
},
+ 'skip_provisioning' => {
+ type => 'checkbox',
+ label => 'Skip provisioning records to this database'
+ },
'ignore_accounting' => {
type => 'checkbox',
label => 'Ignore accounting records from this database'
sub _export_insert {
my($self, $svc_x) = (shift, shift);
+ return '' if $self->option('skip_provisioning');
+
foreach my $table (qw(reply check)) {
my $method = "radius_$table";
my %attrib = $self->$method($svc_x);
sub _export_replace {
my( $self, $new, $old ) = (shift, shift, shift);
+ return '' if $self->option('skip_provisioning');
+
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
local $SIG{QUIT} = 'IGNORE';
sub _export_suspend {
my( $self, $svc_acct ) = (shift, shift);
+ return '' if $self->option('skip_provisioning');
+
my $new = $svc_acct->clone_suspended;
local $SIG{HUP} = 'IGNORE';
sub _export_unsuspend {
my( $self, $svc_x ) = (shift, shift);
+ return '' if $self->option('skip_provisioning');
+
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
local $SIG{QUIT} = 'IGNORE';
sub _export_delete {
my( $self, $svc_x ) = (shift, shift);
+ return '' if $self->option('skip_provisioning');
+
my $jobnum = '';
my $usergroup = $self->option('usergroup') || 'usergroup';
sub sqlradius_connect {
#my($datasrc, $username, $password) = @_;
#DBI->connect($datasrc, $username, $password) or die $DBI::errstr;
- DBI->connect(@_) or die $DBI::errstr;
+ FS::DBI->connect(@_) or die $FS::DBI::errstr;
}
# on success, returns '' in scalar context, ('',$jobnum) in list context
sub import_attrs {
my $self = shift;
- my $dbh = DBI->connect( map $self->option($_),
+ my $dbh = FS::DBI->connect( map $self->option($_),
qw( datasrc username password ) );
unless ( $dbh ) {
- warn "Error connecting to RADIUS server: $DBI::errstr\n";
+ warn "Error connecting to RADIUS server: $FS::DBI::errstr\n";
return;
}