all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
[freeside.git] / htdocs / misc / link.cgi
index d1db000..d18cfcc 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -Tw
 #
-# link: instead of adding a new account, link to an existing. (output form)
+# $Id: link.cgi,v 1.4 1999-01-18 09:41:36 ivan Exp $
 #
 # Note: Should be run setuid freeside as user nobody
 #
@@ -9,10 +9,24 @@
 # rewrite ivan@sisd.com 98-mar-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
+# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
+# (good idea anyway)
+#
+# Revision 1.3  1998/12/23 03:03:39  ivan
+# $cgi->keywords instead of $cgi->query_string
+#
+# Revision 1.2  1998/12/17 09:12:45  ivan
+# s/CGI::(Request|Base)/CGI.pm/;
+#
 
 use strict;
-use CGI::Base qw(:DEFAULT :CGI);
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
 use FS::UID qw(cgisuidsetup);
+use FS::CGI qw(popurl);
 use FS::Record qw(qsearchs);
 
 my(%link_field)=(
@@ -23,12 +37,12 @@ my(%link_field)=(
   'svc_wo'      => '',
 );
 
-my($cgi) = new CGI::Base;
-$cgi->get;
+my($cgi) = new CGI;
 cgisuidsetup($cgi);
 
 my($pkgnum,$svcpart);
-foreach $_ (split(/-/,$QUERY_STRING)) { #get & untaint pkgnum & svcpart
+my($query) = $cgi->keywords;
+foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
   $pkgnum=$1 if /^pkgnum(\d+)$/;
   $svcpart=$1 if /^svcpart(\d+)$/;
 }
@@ -38,18 +52,8 @@ my($svc) = $part_svc->getfield('svc');
 my($svcdb) = $part_svc->getfield('svcdb');
 my($link_field) = $link_field{$svcdb};
 
-CGI::Base::SendHeaders();
-print <<END;
-<HTML>
-  <HEAD>
-    <TITLE>Link to existing $svc account</TITLE>
-  </HEAD>
-  <BODY>
-    <CENTER>
-    <H1>Link to existing $svc account</H1>
-    </CENTER><HR>
-    <FORM ACTION="process/link.cgi" METHOD=POST>
-END
+print $cgi->header( '-expires' => 'now' ), header("Link to existing $svc account"),
+      qq!<FORM ACTION="!, popurl(1), qq!process/link.cgi" METHOD=POST>!;
 
 if ( $link_field ) { 
   print <<END;