From 60900705412d6512db3eb8bae39da50fc5400a7d Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sun, 1 Mar 2009 23:42:51 +0000 Subject: Bug 121601: Have logout display index.cgi, not just a message on relogin.cgi. Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- index.cgi | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'index.cgi') diff --git a/index.cgi b/index.cgi index 89880d163..660909452 100755 --- a/index.cgi +++ b/index.cgi @@ -38,12 +38,24 @@ use Bugzilla::Update; # Check whether or not the user is logged in my $user = Bugzilla->login(LOGIN_OPTIONAL); +my $cgi = Bugzilla->cgi; +my $template = Bugzilla->template; +my $vars = {}; + +# And log out the user if requested. We do this first so that nothing +# else accidentally relies on the current login. +if ($cgi->param('logout')) { + Bugzilla->logout(); + $user = Bugzilla->user; + $vars->{'message'} = "logged_out"; + # Make sure that templates or other code doesn't get confused about this. + $cgi->delete('logout'); +} ############################################################################### # Main Body Execution ############################################################################### -my $cgi = Bugzilla->cgi; # Force to use HTTPS unless Bugzilla->params->{'ssl'} equals 'never'. # This is required because the user may want to log in from here. if ($cgi->protocol ne 'https' && Bugzilla->params->{'sslbase'} ne '' @@ -52,9 +64,6 @@ if ($cgi->protocol ne 'https' && Bugzilla->params->{'sslbase'} ne '' $cgi->require_https(Bugzilla->params->{'sslbase'}); } -my $template = Bugzilla->template; -my $vars = {}; - # Return the appropriate HTTP response headers. print $cgi->header(); -- cgit v1.2.3-24-g4f1b