X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=inline;f=httemplate%2Fmisc%2Flink.cgi;h=f37f769bc3f48d9d1471ec09df88402f1e26817b;hb=7d80f005462758e0271215240cdf99a9336f03dd;hp=18cd378d3691fdcf11f84d2648f48d7fa1c04258;hpb=2041a9143fac20b79ead4a1ae01224dedf5b27c2;p=freeside.git diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi index 18cd378d3..f37f769bc 100755 --- a/httemplate/misc/link.cgi +++ b/httemplate/misc/link.cgi @@ -1,9 +1,64 @@ - -<% +<% include("/elements/header.html","Link to existing $svc") %> + +
+ +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('View/link unlinked services'); my %link_field = ( 'svc_acct' => 'username', 'svc_domain' => 'domain', + 'svc_phone' => 'phonenum', ); my %link_field2 = ( @@ -16,12 +71,10 @@ my %link_field2 = ( }, ); -my($query) = $cgi->keywords; -my($pkgnum, $svcpart) = ('', ''); -foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; -} +$cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum'; +my $pkgnum = $1; +$cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart'; +my $svcpart = $1; my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); my $svc = $part_svc->getfield('svc'); @@ -29,46 +82,4 @@ my $svcdb = $part_svc->getfield('svcdb'); my $link_field = $link_field{$svcdb}; my $link_field2 = $link_field2{$svcdb}; -%> - -<%= header("Link to existing $svc") %> - -