summaryrefslogtreecommitdiff
path: root/httemplate/misc/custom_link_proxy.cgi
blob: e5934e4a6e8d94fdf7b03d3b14a13d52766f566c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% if( $response->is_success ) {
<% $response->decoded_content %>
% }
% else {
<% $response->error_as_HTML %>
% }
<%init>

my( $custnum ) = $cgi->param('custnum');
my $cust_main = qsearchs('cust_main', { custnum => $custnum } ) 
  or die "custnum '$custnum' not found"; # just check for existence

my $conf = new FS::Conf;
my $url = $conf->config('cust_main-custom_link') . $cust_main->custnum;
#warn $url;

my $curuser = $FS::CurrentUser::CurrentUser;

die "access denied"
  unless $curuser->access_right('View customer');

my $ua = new LWP::UserAgent;
my $response = $ua->get($url);
</%init>