From 7edcb0dc22c61bed763581d91295c4edae72c17f Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Fri, 16 Jul 2010 11:41:42 +0200 Subject: Bug 578258: Calling votes.cgi with no arguments should either display the user's votes, or give a better error message if the extension is disabled r/a=mkanat --- votes.cgi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'votes.cgi') diff --git a/votes.cgi b/votes.cgi index dfbadfabc..ef9227af0 100755 --- 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'); -- cgit v1.2.3-24-g4f1b