% # use strict; use vars qw ( %link_field $cgi $pkgnum $svcpart $query $part_svc $svc $svcdb $link_field ); use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); use FS::CGI qw(popurl header); use FS::Record qw(qsearchs); %link_field = ( 'svc_acct' => 'username', 'svc_domain' => 'domain', 'svc_acct_sm' => '', 'svc_charge' => '', 'svc_wo' => '', ); $cgi = new CGI; cgisuidsetup($cgi); ($query) = $cgi->keywords; foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart $pkgnum=$1 if /^pkgnum(\d+)$/; $svcpart=$1 if /^svcpart(\d+)$/; } $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); $svc = $part_svc->getfield('svc'); $svcdb = $part_svc->getfield('svcdb'); $link_field = $link_field{$svcdb}; print header("Link to existing $svc"), qq!