From 3e81855fc65b49d05bf0dc0d1a1cf1b1b044f8f4 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 13 Jun 2006 00:13:34 +0000 Subject: Bug 330487: Automatic Update Notification for Bugzilla - Patch by Frédéric Buclin r=mkanat a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.cgi | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'index.cgi') diff --git a/index.cgi b/index.cgi index a35be0726..27f26083d 100755 --- a/index.cgi +++ b/index.cgi @@ -19,7 +19,7 @@ # Rights Reserved. # # Contributor(s): Jacob Steenhagen -# +# Frédéric Buclin ############################################################################### # Script Initialization @@ -32,9 +32,11 @@ use strict; use lib "."; require "globals.pl"; -# Check whether or not the user is logged in use Bugzilla::Constants; -Bugzilla->login(LOGIN_OPTIONAL); +use Bugzilla::Update; + +# Check whether or not the user is logged in +my $user = Bugzilla->login(LOGIN_OPTIONAL); ############################################################################### # Main Body Execution @@ -48,10 +50,15 @@ if (Param('sslbase') ne '' and Param('ssl') ne 'never') { } my $template = Bugzilla->template; +my $vars = {}; # Return the appropriate HTTP response headers. print $cgi->header(); +if ($user->in_group('admin')) { + $vars->{'release'} = Bugzilla::Update::get_notifications(); +} + # Generate and return the UI (HTML page) from the appropriate template. -$template->process("index.html.tmpl") +$template->process("index.html.tmpl", $vars) || ThrowTemplateError($template->error()); -- cgit v1.2.3-24-g4f1b