From: mkanat%bugzilla.org <> Date: Thu, 4 Jun 2009 22:55:08 +0000 (+0000) Subject: Bug 493642: Never include hidden_fields in the header/footer login form, and when... X-Git-Tag: bugzilla-3.4rc1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71acacd5ee80cbe7131774cce791e2eb8681ac53;p=thirdparty%2Fbugzilla.git Bug 493642: Never include hidden_fields in the header/footer login form, and when a REQUIRE_LOGIN page shows a login form, hide the header/footer login form. Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- diff --git a/Bugzilla.pm b/Bugzilla.pm index 324b3cc145..9ce6232236 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -228,6 +228,10 @@ sub sudo_request { # NOTE: If you want to log the start of an sudo session, do it here. } +sub page_requires_login { + return $_[0]->request_cache->{page_requires_login}; +} + sub login { my ($class, $type) = @_; @@ -235,6 +239,13 @@ sub login { my $authorizer = new Bugzilla::Auth(); $type = LOGIN_REQUIRED if $class->cgi->param('GoAheadAndLogIn'); + + # Allow templates to know that we're in a page that always requires + # login. + if ($type == LOGIN_REQUIRED) { + $class->request_cache->{page_requires_login} = 1; + } + if (!defined $type || $type == LOGIN_NORMAL) { $type = $class->params->{'requirelogin'} ? LOGIN_REQUIRED : LOGIN_NORMAL; } @@ -623,6 +634,13 @@ Logs in a user, returning a C object, or C if there is no logged in user. See L, and L. +=item C + +If the current page always requires the user to log in (for example, +C or any page called with C) then +this will return something true. Otherwise it will return false. (This is +set when you call L.) + =item C Logs out the current user, which involves invalidating user sessions and diff --git a/template/en/default/account/auth/login-small.html.tmpl b/template/en/default/account/auth/login-small.html.tmpl index dd55a72bde..63f6d50d06 100644 --- a/template/en/default/account/auth/login-small.html.tmpl +++ b/template/en/default/account/auth/login-small.html.tmpl @@ -68,10 +68,6 @@ [% END %] -
- [% PROCESS "global/hidden-fields.html.tmpl" - exclude="^Bugzilla_(login|password|restrictlogin|remember)$" %] -