X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fhttp_status.pm;h=3e182d3478846ae2b7a484ebab67638b0f42f8d7;hb=HEAD;hp=80139e7767ab18346984a49f4ef64a2019d76653;hpb=e94760d804c5638ecbd1487e8c3a2797f0034846;p=freeside.git diff --git a/FS/FS/part_export/http_status.pm b/FS/FS/part_export/http_status.pm index 80139e776..3e182d347 100644 --- a/FS/FS/part_export/http_status.pm +++ b/FS/FS/part_export/http_status.pm @@ -8,6 +8,7 @@ use URI::Escape; use LWP::UserAgent; use HTTP::Request::Common; use Email::Valid; +use Carp qw(carp); tie my %options, 'Tie::IxHash', 'url' => { label => 'URL', }, @@ -53,6 +54,12 @@ sub _export_delete { '' }; sub export_getstatus { my( $self, $svc_x, $htmlref, $hashref ) = @_; + if ( $FS::svc_Common::noexport_hack ) { + carp 'export_getstatus() suppressed by noexport_hack' + if $self->option('debug') || $DEBUG; + return; + } + my $url; my $urlopt = $self->option('url'); no strict 'vars'; @@ -129,7 +136,13 @@ sub export_setstatus_listdel { } sub export_setstatus_listX { - my( $self, $svc_x, $action, $list, $address ) = @_; + my( $self, $svc_x, $action, $list, $address_item ) = @_; + + if ( $FS::svc_Common::noexport_hack ) { + carp 'export_setstatus_listX() suppressed by noexport_hack' + if $self->option('debug') || $DEBUG; + return; + } my $option; if ( $list =~ /^[WA]/i ) { #Whitelist/Allow @@ -139,8 +152,16 @@ sub export_setstatus_listX { } $option .= $action. '_url'; - $address = Email::Valid->address($address) - or die "address failed $Email::Valid::Details check.\n"; + my $address; + unless ( $address = Email::Valid->address($address_item) ) { + + if ( $address_item =~ /^(\@[\w\-\.]+\.\w{2,63})$/ ) { # "@domain" + $address = $1; + } else { + die "address failed $Email::Valid::Details check.\n"; + } + + } #some false laziness w/export_getstatus above my $url; @@ -174,6 +195,12 @@ sub export_setstatus_vacationdel { sub export_setstatus_vacationX { my( $self, $svc_x, $action, $hr ) = @_; + if ( $FS::svc_Common::noexport_hack ) { + carp 'export_setstatus_vacationX() suppressed by noexport_hack' + if $self->option('debug') || $DEBUG; + return; + } + my $option = 'vacation_'. $action. '_url'; my $subject = uri_escape($hr->{subject}); @@ -208,5 +235,3 @@ sub export_setstatus_vacationX { } 1; - -1;