]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 398075: Bugzilla should be able to display the "shutdownhtml" message even if...
authorlpsolit%gmail.com <>
Sun, 21 Sep 2008 23:40:40 +0000 (23:40 +0000)
committerlpsolit%gmail.com <>
Sun, 21 Sep 2008 23:40:40 +0000 (23:40 +0000)
Bugzilla.pm
template/en/default/global/common-links.html.tmpl
template/en/default/global/field-descs.none.tmpl

index ba3e75d892f4df032f2280309b27928d8168398a..b8d2e9b84df07f25fe5a3a1808a53fe9cdca98a4 100644 (file)
@@ -139,7 +139,13 @@ sub init_page {
 
         # For security reasons, log out users when Bugzilla is down.
         # Bugzilla->login() is required to catch the logincookie, if any.
-        my $user = Bugzilla->login(LOGIN_OPTIONAL);
+        my $user;
+        eval { $user = Bugzilla->login(LOGIN_OPTIONAL); };
+        if ($@) {
+            # The DB is not accessible. Use the default user object.
+            $user = Bugzilla->user;
+            $user->{settings} = {};
+        }
         my $userid = $user->id;
         Bugzilla->logout();
 
index 4690d177a50fa5e42df0085c08a4df2b136d1281..18695a8c6ff3cdcfeb4cba901bced8074d1a0b26 100644 (file)
@@ -39,7 +39,7 @@
   <li><span class="separator">| </span><a href="report.cgi">Reports</a></li>
 
   <li>
-    [% IF Bugzilla.has_flags %]
+    [% IF Param('shutdownhtml') || Bugzilla.has_flags %]
       <span class="separator">| </span>
       [% IF user.id %]
         <a href="request.cgi?requester=[% user.login FILTER url_quote %]&amp;requestee=
index f669df6df2b9a25cae6025261031d679ceab3d1e..7d89bd5c26dea256cf147348e8ce5fcece2d8e92 100644 (file)
     database. If you want to override this for your language
     or your installation, just use a hook. %]
 
-[% USE Bugzilla %]
-[% FOREACH bz_field = Bugzilla.get_fields() %]
-  [% SET field_descs.${bz_field.name} = bz_field.description
-     IF !field_descs.${bz_field.name}.defined %]
+[% UNLESS Param('shutdownhtml') %]
+  [% USE Bugzilla %]
+  [% FOREACH bz_field = Bugzilla.get_fields() %]
+    [% SET field_descs.${bz_field.name} = bz_field.description
+       IF !field_descs.${bz_field.name}.defined %]
+  [% END %]
 [% END %]
 
 [% field_types = { ${constants.FIELD_TYPE_UNKNOWN}       => "Unknown Type",