diff options
author | mark <mark> | 2010-08-03 03:30:20 +0000 |
---|---|---|
committer | mark <mark> | 2010-08-03 03:30:20 +0000 |
commit | 720cf723d2c8e88760704e2fdc50ebf48e0574f2 (patch) | |
tree | cfd22ecedf5c9db463fe345c193d51e5a88052ac /httemplate/misc | |
parent | 746eb018918ec4660870c79d0ff907fe0920696a (diff) |
customer view tab for an external info page, RT#8903
Diffstat (limited to 'httemplate/misc')
-rw-r--r-- | httemplate/misc/custom_link_proxy.cgi | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/httemplate/misc/custom_link_proxy.cgi b/httemplate/misc/custom_link_proxy.cgi new file mode 100644 index 000000000..e5934e4a6 --- /dev/null +++ b/httemplate/misc/custom_link_proxy.cgi @@ -0,0 +1,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> |