diff options
author | mkanat%bugzilla.org <> | 2009-03-02 00:42:51 +0100 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-03-02 00:42:51 +0100 |
commit | 60900705412d6512db3eb8bae39da50fc5400a7d (patch) | |
tree | 5f35c42527f2514c043deb099ef2eac90b311594 /index.cgi | |
parent | b4ab958823eaf0cddb1ce15f8af9ed7539b300cf (diff) | |
download | bugzilla-60900705412d6512db3eb8bae39da50fc5400a7d.tar.gz bugzilla-60900705412d6512db3eb8bae39da50fc5400a7d.tar.xz |
Bug 121601: Have logout display index.cgi, not just a message on relogin.cgi.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'index.cgi')
-rwxr-xr-x | index.cgi | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -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(); |