]> 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:42:44 +0000 (23:42 +0000)
committerlpsolit%gmail.com <>
Sun, 21 Sep 2008 23:42:44 +0000 (23:42 +0000)
Bugzilla.pm
template/en/default/global/common-links.html.tmpl
template/en/default/global/field-descs.none.tmpl

index abba18924ada792d9538351d237f11f34ad353ac..df19d2fdaa83c5fb059c823ec1e6cd866836d106 100644 (file)
@@ -138,7 +138,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 bfd18af4d5e668734980f548de3753a42c2851c2..29822d4429e215657fcb16c700c0f7d568c861a7 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 08587a4624dc5cc01fe0dea086bd2b76220e5192..344dc5528741621ffbef54aac1a10d9962d099f3 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",