X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fcustom_link_proxy.cgi;h=db9a048be5339dd21283c33e2f84fc8d0acd3f6b;hp=e5934e4a6e8d94fdf7b03d3b14a13d52766f566c;hb=2eea268a59cf357853e31ff8d5db6033e4bdc8ea;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/httemplate/misc/custom_link_proxy.cgi b/httemplate/misc/custom_link_proxy.cgi index e5934e4a6..db9a048be 100644 --- a/httemplate/misc/custom_link_proxy.cgi +++ b/httemplate/misc/custom_link_proxy.cgi @@ -11,10 +11,20 @@ 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 $url = $conf->config('cust_main-custom_link'); +my $agentnum = $cust_main->agentnum; +my $agent_custid = $cust_main->agent_custid; my $curuser = $FS::CurrentUser::CurrentUser; +my $usernum = $curuser->usernum; +# like eval(qq("$url")) but with fewer things that can go wrong +# and if $custnum isn't mentioned, assume it goes at the end +$url =~ s/\$custnum/$custnum/ or $url .= $custnum; +$url =~ s/\$agentnum/$agentnum/; +$url =~ s/\$agent_custid/$agent_custid/; +$url =~ s/\$usernum/$usernum/; + +#warn $url; die "access denied" unless $curuser->access_right('View customer');