From 2158e6d923efb1207e3c4cea44eceda9b16d497e Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 6 Feb 2012 22:28:15 +0000 Subject: [PATCH] HTTP export for svc_broadband, #16227 --- FS/FS/part_export/broadband_http.pm | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 FS/FS/part_export/broadband_http.pm diff --git a/FS/FS/part_export/broadband_http.pm b/FS/FS/part_export/broadband_http.pm new file mode 100644 index 000000000..9edfee5d3 --- /dev/null +++ b/FS/FS/part_export/broadband_http.pm @@ -0,0 +1,66 @@ +package FS::part_export::broadband_http; + +use vars qw( @ISA %info ); +use FS::part_export::http; +use Tie::IxHash; + +@ISA = qw( FS::part_export::http ); + +tie %options, 'Tie::IxHash', + 'method' => { label =>'Method', + type =>'select', + #options =>[qw(POST GET)], + options =>[qw(POST)], + default =>'POST' }, + 'url' => { label => 'URL', default => 'http://', }, + 'insert_data' => { + label => 'Insert data', + type => 'textarea', + default => join("\n", + "action 'add'", + "address \$svc_x->ip_addr", + "name \$cust_main->first.' '.\$cust_main->last", + ), + }, + 'delete_data' => { + label => 'Delete data', + type => 'textarea', + default => join("\n", + "action 'remove'", + "address \$svc_x->ip_addr", + ), + }, + 'replace_data' => { + label => 'Replace data', + type => 'textarea', + default => '', + }, + 'success_regexp' => { + label => 'Success Regexp', + default => '', + }, +; + +%info = ( + 'svc' => 'svc_broadband', + 'desc' => 'Send an HTTP or HTTPS GET or POST request, for accounts.', + 'options' => \%options, + 'notes' => <<'END' +

Send an HTTP or HTTPS GET or POST to the specified URL on account addition, +modification and deletion. For HTTPS support, +Crypt::SSLeay +or IO::Socket::SSL +is required.

+

Each "Data" option takes a list of name value pairs on successive +lines. +

+If "Success Regexp" is specified, the response from the server will be +tested against it to determine if the export succeeded.

+END +); + +1; -- 2.11.0