X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fsqlradius.pm;h=9e65e51a660a67c7317052b5651c3fe3a0c33563;hp=048a244853355d2bb7b40a409438b23b98632563;hb=87c195131764ee7307e834bfb5b36b9e6ba14d07;hpb=9aee669886202be7035e6c6049fc71bc99dd3013 diff --git a/FS/FS/part_export/sqlradius.pm b/FS/FS/part_export/sqlradius.pm index 048a24485..9e65e51a6 100644 --- a/FS/FS/part_export/sqlradius.pm +++ b/FS/FS/part_export/sqlradius.pm @@ -26,6 +26,10 @@ tie %options, 'Tie::IxHash', 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' @@ -80,10 +84,6 @@ tie %options, 'Tie::IxHash', 'disconnect_port' => { label => 'Port to send disconnection requests to, default 1700', }, - 'disconnect_ignore_error' => { - label => 'Ignore disconnection request errors', - type => 'checkbox', - }, ; $notes1 = <<'END'; @@ -158,6 +158,8 @@ sub radius_check { #override for other svcdb 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); @@ -183,6 +185,8 @@ sub _export_insert { 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'; @@ -270,7 +274,6 @@ sub _export_replace { 'disconnect_ssh' => $self->option('disconnect_ssh'), 'svc_acct_username' => $old->username, 'disconnect_port' => $self->option('disconnect_port'), - 'ignore_error' => $self->option('disconnect_ignore_error'), ); unless ( ref($err_or_queue) ) { $dbh->rollback if $oldAutoCommit; @@ -294,6 +297,8 @@ sub _export_replace { 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'; @@ -365,6 +370,8 @@ sub _export_suspend { 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'; @@ -404,6 +411,8 @@ sub _export_unsuspend { sub _export_delete { my( $self, $svc_x ) = (shift, shift); + return '' if $self->option('skip_provisioning'); + my $jobnum = ''; my $usergroup = $self->option('usergroup') || 'usergroup'; @@ -418,7 +427,6 @@ sub _export_delete { 'disconnect_ssh' => $self->option('disconnect_ssh'), 'svc_acct_username' => $svc_x->username, 'disconnect_port' => $self->option('disconnect_port'), - 'ignore_error' => $self->option('disconnect_ignore_error'), ); return $err_or_queue unless ref($err_or_queue); if ( $jobnum ) { @@ -1258,8 +1266,6 @@ I - the user to be disconnected (required) I - the port (on the nas) to send disconnect requests to (defaults to 1700) -I - do not die on error with the disconnect request - Note this is NOT the opposite of sqlradius_connect. =cut @@ -1294,7 +1300,7 @@ sub sqlradius_user_disconnect { if $error && (@$nas > 1); $error = "No clients found" unless @$nas; - die $error if $error && !$opt{'ignore_error'}; + die $error if $error; return ''; }