summaryrefslogtreecommitdiffstats
path: root/votes.cgi
diff options
context:
space:
mode:
authorbbaetz%acm.org <>2003-05-05 10:15:19 +0200
committerbbaetz%acm.org <>2003-05-05 10:15:19 +0200
commit9488a8906592564ec2e7601041f3ea5484cde3cc (patch)
treeb9308d1a3dcf639d1e561ede1186ff58afc01834 /votes.cgi
parentc000c0a480f2cb73f2b0b89550bbd8e496b73c9d (diff)
downloadbugzilla-9488a8906592564ec2e7601041f3ea5484cde3cc.tar.gz
bugzilla-9488a8906592564ec2e7601041f3ea5484cde3cc.tar.xz
Bug 201816 - use CGI.pm for header output
r=joel, a=justdave
Diffstat (limited to 'votes.cgi')
-rwxr-xr-xvotes.cgi19
1 files changed, 14 insertions, 5 deletions
diff --git a/votes.cgi b/votes.cgi
index e386d5422..aa2352f4a 100755
--- a/votes.cgi
+++ b/votes.cgi
@@ -26,14 +26,17 @@
use strict;
use lib ".";
-require "CGI.pl";
+use Bugzilla;
+require "CGI.pl";
# Use global template variables
use vars qw($template $vars);
ConnectToDatabase();
+my $cgi = Bugzilla->cgi;
+
# If the action is show_bug, you need a bug_id.
# If the action is show_user, you can supply a userid to show the votes for
# another user, otherwise you see your own.
@@ -86,6 +89,8 @@ exit;
# Display the names of all the people voting for this one bug.
sub show_bug {
+ my $cgi = Bugzilla->cgi;
+
my $bug_id = $::FORM{'bug_id'}
|| ThrowCodeError("missing_bug_id");
@@ -107,7 +112,7 @@ sub show_bug {
$vars->{'users'} = \@users;
$vars->{'total'} = $total;
- print "Content-type: text/html\n\n";
+ print $cgi->header();
$template->process("bug/votes/list-for-bug.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
}
@@ -117,6 +122,8 @@ sub show_bug {
sub show_user {
GetVersionTable();
+ my $cgi = Bugzilla->cgi;
+
# If a bug_id is given, and we're editing, we'll add it to the votes list.
my $bug_id = $::FORM{'bug_id'} || "";
@@ -213,7 +220,7 @@ sub show_user {
$vars->{'voting_user'} = { "login" => $name };
$vars->{'products'} = \@products;
- print "Content-type: text/html\n\n";
+ print $cgi->header();
$template->process("bug/votes/list-for-user.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
}
@@ -224,6 +231,8 @@ sub record_votes {
# Begin Data/Security Validation
############################################################################
+ my $cgi = Bugzilla->cgi;
+
# Build a list of bug IDs for which votes have been submitted. Votes
# are submitted in form fields in which the field names are the bug
# IDs and the field values are the number of votes.
@@ -233,13 +242,13 @@ sub record_votes {
# that their votes will get nuked if they continue.
if (scalar(@buglist) == 0) {
if (!defined($::FORM{'delete_all_votes'})) {
- print "Content-type: text/html\n\n";
+ print $cgi->header();
$template->process("bug/votes/delete-all.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
exit();
}
elsif ($::FORM{'delete_all_votes'} == 0) {
- print "Location: votes.cgi\n\n";
+ print $cgi->redirect("votes.cgi");
exit();
}
}