From 3cdf7e4e0b9f2b1ad44a45e1ab974f7a87372700 Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Tue, 14 Aug 2018 19:53:23 -0400 Subject: [PATCH] RT# 78547 noexport_hack part_export::shellcommands --- FS/FS/part_export/shellcommands.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm index 09fa71b94..7099ca8ac 100644 --- a/FS/FS/part_export/shellcommands.pm +++ b/FS/FS/part_export/shellcommands.pm @@ -7,6 +7,7 @@ use String::ShellQuote; use Net::OpenSSH; use FS::part_export; use FS::Record qw( qsearch qsearchs ); +use Carp qw(carp); @ISA = qw(FS::part_export); @@ -267,6 +268,12 @@ sub _export_unsuspend { sub export_pkg_change { my( $self, $svc_acct, $new_cust_pkg, $old_cust_pkg ) = @_; + if ( $FS::svc_Common::noexport_hack ) { + carp 'export_pkg_change() suppressed by noexport_hack' + if $self->option('debug'); + return; + } + my @fields = qw( pkgnum pkgpart agent_pkgid ); #others? my @date_fields = qw( order_date start_date setup bill last_bill susp adjourn resume cancel uncancel expire contract_end ); @@ -291,6 +298,13 @@ sub export_pkg_change { sub _export_command_or_super { my($self, $action) = (shift, shift); + + if ( $FS::svc_Common::noexport_hack ) { + carp "_export_command_or_super($action) suppressed by noexport_hack" + if $self->option('debug'); + return; + } + if ( $self->option($action) =~ /^\s*$/ ) { my $method = "SUPER::_export_$action"; $self->$method(@_); @@ -303,6 +317,12 @@ sub _export_command { my ( $self, $action, $svc_acct) = (shift, shift, shift); my $command = $self->option($action); + if ( $FS::svc_Common::noexport_hack ) { + carp "_export_command($action) suppressed by noexport_hack" + if $self->option('debug'); + return; + } + return '' if $command =~ /^\s*$/; my $stdin = $self->option($action."_stdin"); -- 2.11.0