X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htdocs%2Fmisc%2Flink.cgi;h=eb17807118199adbf162b62c1bbb80e963c8a0d7;hb=3bfec7cf75a1a4eb4da1cdf8c64003bd6babcd81;hp=d18cfccc130b1d018f9ab76e9886d9f0f4e31179;hpb=183f64ede863fff923db7e00d962b3495e405477;p=freeside.git diff --git a/htdocs/misc/link.cgi b/htdocs/misc/link.cgi index d18cfccc1..eb1780711 100755 --- a/htdocs/misc/link.cgi +++ b/htdocs/misc/link.cgi @@ -1,8 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: link.cgi,v 1.4 1999-01-18 09:41:36 ivan Exp $ -# -# Note: Should be run setuid freeside as user nobody +# $Id: link.cgi,v 1.7 1999-04-08 11:31:40 ivan Exp $ # # ivan@voicenet.com 97-feb-5 # @@ -11,7 +9,17 @@ # can also link on some other fields now (about time) ivan@sisd.com 98-jun-24 # # $Log: link.cgi,v $ -# Revision 1.4 1999-01-18 09:41:36 ivan +# Revision 1.7 1999-04-08 11:31:40 ivan +# *** empty log message *** +# +# Revision 1.6 1999/02/28 00:03:51 ivan +# removed misleading comments +# +# Revision 1.5 1999/01/19 05:14:06 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.4 1999/01/18 09:41:36 ivan # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl # (good idea anyway) # @@ -23,13 +31,15 @@ # 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); +use FS::CGI qw(popurl header); use FS::Record qw(qsearchs); -my(%link_field)=( +%link_field = ( 'svc_acct' => 'username', 'svc_domain' => 'domain', 'svc_acct_sm' => '', @@ -37,22 +47,21 @@ my(%link_field)=( 'svc_wo' => '', ); -my($cgi) = new CGI; +$cgi = new CGI; cgisuidsetup($cgi); -my($pkgnum,$svcpart); -my($query) = $cgi->keywords; +($query) = $cgi->keywords; foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart $pkgnum=$1 if /^pkgnum(\d+)$/; $svcpart=$1 if /^svcpart(\d+)$/; } -my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart}); -my($svc) = $part_svc->getfield('svc'); -my($svcdb) = $part_svc->getfield('svcdb'); -my($link_field) = $link_field{$svcdb}; +$part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); +$svc = $part_svc->getfield('svc'); +$svcdb = $part_svc->getfield('svcdb'); +$link_field = $link_field{$svcdb}; -print $cgi->header( '-expires' => 'now' ), header("Link to existing $svc account"), +print $cgi->header( '-expires' => 'now' ), header("Link to existing $svc"), qq!
!; if ( $link_field ) {