From 9488a8906592564ec2e7601041f3ea5484cde3cc Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Mon, 5 May 2003 08:15:19 +0000 Subject: Bug 201816 - use CGI.pm for header output r=joel, a=justdave --- colchange.cgi | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'colchange.cgi') diff --git a/colchange.cgi b/colchange.cgi index 5e28a4622..2ff2f3fee 100755 --- a/colchange.cgi +++ b/colchange.cgi @@ -32,6 +32,8 @@ use vars qw( $vars ); +use Bugzilla; + require "CGI.pl"; ConnectToDatabase(); @@ -39,6 +41,8 @@ quietly_check_login(); GetVersionTable(); +my $cgi = Bugzilla->cgi; + # The master list not only says what fields are possible, but what order # they get displayed in. my @masterlist = ("opendate", "changeddate", "bug_severity", "priority", @@ -87,12 +91,15 @@ if (defined $::FORM{'rememberedquery'}) { } my $list = join(" ", @collist); my $urlbase = Param("urlbase"); - my $cookiepath = Param("cookiepath"); - - print "Set-Cookie: COLUMNLIST=$list ; path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n"; - print "Set-Cookie: SPLITHEADER=$::FORM{'splitheader'} ; path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n"; - print "Refresh: 0; URL=buglist.cgi?$::FORM{'rememberedquery'}\n"; - print "Content-type: text/html\n\n"; + + $cgi->send_cookie(-name => 'COLUMNLIST', + -value => $list, + -expires => 'Fri, 01-Jan-2038 00:00:00 GMT'); + $cgi->send_cookie(-name => 'SPLITHEADER', + -value => $::FORM{'splitheader'}, + -expires => 'Fri, 01-Jan-2038 00:00:00 GMT'); + + print $cgi->redirect("buglist.cgi?$::FORM{'rememberedquery'}"); $vars->{'message'} = "change_columns"; $template->process("global/message.html.tmpl", $vars) || ThrowTemplateError($template->error()); @@ -111,6 +118,6 @@ $vars->{'splitheader'} = $::COOKIE{'SPLITHEADER'} ? 1 : 0; $vars->{'buffer'} = $::buffer; # Generate and return the UI (HTML page) from the appropriate template. -print "Content-type: text/html\n\n"; +print $cgi->header(); $template->process("list/change-columns.html.tmpl", $vars) || ThrowTemplateError($template->error()); -- cgit v1.2.3-24-g4f1b