diff options
author | kiko%async.com.br <> | 2004-04-07 10:38:25 +0000 |
---|---|---|
committer | kiko%async.com.br <> | 2004-04-07 10:38:25 +0000 |
commit | 951d8c39c8b4493960720ae1d1abb5c2c35e4946 (patch) | |
tree | 61e54981272c38541553cbd3caff641b521df654 | |
parent | abcd7bf18cb0bcd7fd492191977805d15c28646b (diff) | |
download | bugs-951d8c39c8b4493960720ae1d1abb5c2c35e4946.tar bugs-951d8c39c8b4493960720ae1d1abb5c2c35e4946.tar.gz bugs-951d8c39c8b4493960720ae1d1abb5c2c35e4946.tar.bz2 bugs-951d8c39c8b4493960720ae1d1abb5c2c35e4946.tar.xz bugs-951d8c39c8b4493960720ae1d1abb5c2c35e4946.zip |
Fix for bug 238862: remove %FORM and %COOKIE from enter_bug.cgi. Does
that, and also fixes up the bug creation template. r=justdave, a=justdave.
-rwxr-xr-x | enter_bug.cgi | 31 | ||||
-rw-r--r-- | template/en/default/bug/create/create.html.tmpl | 3 |
2 files changed, 16 insertions, 18 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi index 1dd02c90c..8962dfad5 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -44,7 +44,6 @@ use vars qw( $unconfirmedstate $template $vars - %COOKIE @enterable_products @legal_opsys @legal_platform @@ -52,7 +51,6 @@ use vars qw( @legal_severity @legal_keywords $userid - %MFORM %versions $proddesc ); @@ -63,7 +61,9 @@ Bugzilla->login(LOGIN_REQUIRED) if AnyEntryGroups(); my $cgi = Bugzilla->cgi; -if (!defined $::FORM{'product'}) { +my $product = $cgi->param('product'); + +if (!defined $product) { GetVersionTable(); Bugzilla->login(); @@ -84,27 +84,24 @@ if (!defined $::FORM{'product'}) { $vars->{'proddesc'} = \%products; $vars->{'target'} = "enter_bug.cgi"; - $vars->{'format'} = $::FORM{'format'}; + $vars->{'format'} = $cgi->param('format'); print $cgi->header(); $template->process("global/choose-product.html.tmpl", $vars) || ThrowTemplateError($template->error()); exit; + } else { + # Only one product exists + $product = (keys %products)[0]; } - - $::FORM{'product'} = (keys %products)[0]; - $::MFORM{'product'} = [$::FORM{'product'}]; - } -my $product = $::FORM{'product'}; - ############################################################################## # Useful Subroutines ############################################################################## sub formvalue { my ($name, $default) = (@_); - return $::FORM{$name} || $default || ""; + return $cgi->param($name) || $default || ""; } sub pickplatform { @@ -242,7 +239,7 @@ if (0 == @{$::components{$product}}) { } elsif (1 == @{$::components{$product}}) { # Only one component; just pick it. - $::FORM{'component'} = $::components{$product}->[0]; + $cgi->param('component', $::components{$product}->[0]); } my @components; @@ -268,7 +265,6 @@ $default{'component_'} = formvalue('component'); $vars->{'assigned_to'} = formvalue('assigned_to'); $vars->{'cc'} = formvalue('cc'); -$vars->{'reporter'} = $::COOKIE{'Bugzilla_login'}; $vars->{'product'} = $product; $vars->{'bug_file_loc'} = formvalue('bug_file_loc', "http://"); $vars->{'short_desc'} = formvalue('short_desc'); @@ -299,9 +295,9 @@ $vars->{'blocked'} = formvalue('blocked'); $vars->{'version'} = $::versions{$product} || []; if (formvalue('version')) { $default{'version'} = formvalue('version'); -} elsif (exists $::COOKIE{"VERSION-$product"} && - lsearch($vars->{'version'}, $::COOKIE{"VERSION-$product"}) != -1) { - $default{'version'} = $::COOKIE{"VERSION-$product"}; +} elsif (defined $cgi->cookie("VERSION-$product") && + lsearch($vars->{'version'}, $cgi->cookie("VERSION-$product")) != -1) { + $default{'version'} = $cgi->cookie("VERSION-$product"); } else { $default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}]; } @@ -370,7 +366,8 @@ $vars->{'default'} = \%default; $vars->{'use_keywords'} = 1 if (@::legal_keywords); my $format = - GetFormat("bug/create/create", $::FORM{'format'}, $::FORM{'ctype'}); + GetFormat("bug/create/create", scalar $cgi->param('format'), + scalar $cgi->param('ctype')); print $cgi->header($format->{'ctype'}); $template->process($format->{'template'}, $vars) diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index bc11f2be0..049640f2a 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -27,6 +27,7 @@ h2 = "This page lets you enter a new $terms.bug into ${terms.Bugzilla}." onload="set_assign_to();" %] +[% USE Bugzilla %] <script type="text/javascript" language="JavaScript"> <!-- @@ -91,7 +92,7 @@ function set_assign_to() { <tr> <td align="right" valign="top"><strong>Reporter:</strong></td> - <td valign="top">[% reporter FILTER html %]</td> + <td valign="top">[% Bugzilla.user.login FILTER html %]</td> <td align="right" valign="top"><strong>Product:</strong></td> <td valign="top">[% product FILTER html %]</td> |