]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 578258: Calling votes.cgi with no arguments should either display the user's...
authorFrédéric Buclin <LpSolit@gmail.com>
Fri, 16 Jul 2010 09:46:20 +0000 (11:46 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 16 Jul 2010 09:46:20 +0000 (11:46 +0200)
r/a=mkanat

template/en/default/global/code-error.html.tmpl
votes.cgi

index 177d47621de51e892f9f3ad17dc3c35b7409d095..8b9e070c9d7718154403b7ab5e098bc48c3a5693 100644 (file)
       address.
     [% END %]
 
+  [% ELSIF error == "extension_disabled" %]
+    [% title = "Extension Disabled" %]
+    You cannot access this page because the extension '[% name FILTER html %]'
+    is disabled.
+
   [% ELSIF error == "extension_must_be_subclass" %]
     <code>[% package FILTER html %]</code> from 
     <code>[% filename FILTER html %]</code> is not a subclass of
index dfbadfabc1c1f69e86de09858336f3629c2e7cfa..ef9227af055d387c0976ca0d3786f2bf06038407 100755 (executable)
--- a/votes.cgi
+++ b/votes.cgi
@@ -28,10 +28,11 @@ use lib qw(. lib);
 use Bugzilla;
 use Bugzilla::Error;
 
-my $cgi = Bugzilla->cgi;
+my $is_enabled = grep { $_->NAME eq 'Voting' } @{ Bugzilla->extensions };
+$is_enabled || ThrowCodeError('extension_disabled', { name => 'Voting' });
 
-my $to_url;
-my $action = $cgi->param('action');
+my $cgi = Bugzilla->cgi;
+my $action = $cgi->param('action') || 'show_user';
 
 if ($action eq "show_bug") {
     $cgi->delete('action');