]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix and use use_login_page for the BlockIP pre-rendered page (#79)
authorVladimir Panteleev <CyberShadow@users.noreply.github.com>
Sat, 13 Feb 2021 17:25:21 +0000 (17:25 +0000)
committerGitHub <noreply@github.com>
Sat, 13 Feb 2021 17:25:21 +0000 (12:25 -0500)
* template/en/default: Fix use_login_page

The implementation fell off in
2e5d910d9401c4fa8f105d8f9502d9e4ea27bb99.

* template/en/default/global/ip-blocked.html.tmpl: Use use_login_page

This fixes the warning "Use of uninitialized value $args[1] in join or
string at .../Bugzilla/Token.pm line 270", and removes the
likely-broken mini login form on the "IP blocked" page.

* index.cgi: Disable use_login_page for the front page

This seems to be only useful for very high-traffic
installations (BMO).

Co-authored-by: Dylan Hardison <dylan@hardison.net>
index.cgi
template/en/default/account/auth/login-small.html.tmpl
template/en/default/global/header.html.tmpl
template/en/default/global/ip-blocked.html.tmpl

index 02896ae3835cc2fc48b7a8596980a50d6d2f4e41..82fa5ede97045fadd325d2e9dff83cb1040066f9 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -90,8 +90,6 @@ else {
     $vars->{'release'} = Bugzilla::Update::get_notifications();
   }
 
-  $vars->{use_login_page} = 1;
-
   # Generate and return the UI (HTML page) from the appropriate template.
   $template->process("index.html.tmpl", $vars)
     or ThrowTemplateError($template->error());
index a860d071c1594e6d5022dedd78d4187e77a7edac..201d0cb99eefc92bedb259dde2685c3488ec6034 100644 (file)
   [% END %]
   [% script_url = login_target _ connector _ "GoAheadAndLogIn=1" %]
   <a id="login_link[% qs_suffix %]" href="[% script_url FILTER html %]"
-     class='show_mini_login_form' data-qs-suffix="[% qs_suffix FILTER html %]">Log In</a>
+     [% IF !use_login_page %]
+     class='show_mini_login_form'
+     [% END %]
+     data-qs-suffix="[% qs_suffix FILTER html %]">Log In</a>
 
+  [% IF !use_login_page %]
   <div id="mini_login[% qs_suffix FILTER html %]" class="mini-popup mini_login bz_default_hidden">
   [% Hook.process('additional_methods') %]
 
@@ -86,7 +90,9 @@
     </a>
   </form>
   </div>
+  [% END %]
 </li>
+[% IF !use_login_page %]
 <li id="forgot_container[% qs_suffix %]">
   <a id="forgot_link[% qs_suffix %]" href="[% script_url FILTER html %]#forgot"
      class='show_forgot_form'
   </form>
   </div>
 </li>
+[% END %]
index cbef59f2a5943aee69cce0a82703afe7f97e6088..3d1bf4ba8410d678534feb85fe32804d8231d74f 100644 (file)
       <ul id="header-login" class="links">
           [% PROCESS "account/auth/signup-small.html.tmpl" qs_suffix = "_top" %]
         [% IF user.authorizer.can_login %]
-          [% PROCESS "account/auth/login-small.html.tmpl" qs_suffix = "_top" %]
+          [% PROCESS "account/auth/login-small.html.tmpl" qs_suffix = "_top" use_login_page = use_login_page %]
         [% END %]
       </ul>
     [% END %]
index b60ea41ea2b9db2290cd82fd7a7c497c1c69f8cc..eb0ec9efab6b0533c673a09185f823ce68405784 100644 (file)
@@ -3,6 +3,7 @@
 [% title = "Too Many Requests" %]
 
 [% PROCESS global/header.html.tmpl
+           use_login_page = 1
            robots = 'noindex' %]
 
 <h1>[% title FILTER html %]</h1>