X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fcustom_link_proxy.cgi;h=f3c6e376eff32f79bf48864203147e03b790f0ed;hb=72be499dfee94a565cae7d1caf795e27bf29b486;hp=e5934e4a6e8d94fdf7b03d3b14a13d52766f566c;hpb=720cf723d2c8e88760704e2fdc50ebf48e0574f2;p=freeside.git diff --git a/httemplate/misc/custom_link_proxy.cgi b/httemplate/misc/custom_link_proxy.cgi index e5934e4a6..f3c6e376e 100644 --- a/httemplate/misc/custom_link_proxy.cgi +++ b/httemplate/misc/custom_link_proxy.cgi @@ -11,10 +11,18 @@ 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 $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/\$usernum/$usernum/; + +#warn $url; die "access denied" unless $curuser->access_right('View customer');