aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'index.cgi')
-rwxr-xr-xindex.cgi27
1 files changed, 16 insertions, 11 deletions
diff --git a/index.cgi b/index.cgi
index 68352c084..15d34451d 100755
--- a/index.cgi
+++ b/index.cgi
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -wT
+#!/usr/bin/perl -T
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -6,14 +6,10 @@
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
-###############################################################################
-# Script Initialization
-###############################################################################
-
-# Make it harder for us to do dangerous things in Perl.
+use 5.10.1;
use strict;
+use warnings;
-# Include the Bugzilla CGI and general utility library.
use lib qw(. lib);
use Bugzilla;
@@ -37,10 +33,6 @@ if ($cgi->param('logout')) {
$cgi->delete('logout');
}
-###############################################################################
-# Main Body Execution
-###############################################################################
-
# Return the appropriate HTTP response headers.
print $cgi->header();
@@ -55,6 +47,19 @@ if ($user->in_group('admin')) {
$vars->{'release'} = Bugzilla::Update::get_notifications();
}
+if ($user->id) {
+ my $dbh = Bugzilla->dbh;
+ $vars->{assignee_count} =
+ $dbh->selectrow_array("SELECT COUNT(*) FROM bugs WHERE assigned_to = ?
+ AND resolution = ''", undef, $user->id);
+ $vars->{reporter_count} =
+ $dbh->selectrow_array("SELECT COUNT(*) FROM bugs WHERE reporter = ?
+ AND resolution = ''", undef, $user->id);
+ $vars->{requestee_count} =
+ $dbh->selectrow_array('SELECT COUNT(DISTINCT bug_id) FROM flags
+ WHERE requestee_id = ?', undef, $user->id);
+}
+
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("index.html.tmpl", $vars)
|| ThrowTemplateError($template->error());