diff options
author | lpsolit%gmail.com <> | 2008-09-22 01:40:40 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2008-09-22 01:40:40 +0200 |
commit | b8ec302b3a99b54f5838e497adb1cabe3f2f15dd (patch) | |
tree | e33219c188490606f9661fb46fc102f27b43a78a | |
parent | bea6f25db1bf8f4333b3bf72d73015c7cdb9a197 (diff) | |
download | bugzilla-b8ec302b3a99b54f5838e497adb1cabe3f2f15dd.tar.gz bugzilla-b8ec302b3a99b54f5838e497adb1cabe3f2f15dd.tar.xz |
Bug 398075: Bugzilla should be able to display the "shutdownhtml" message even if the SQL server is down - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
-rw-r--r-- | Bugzilla.pm | 8 | ||||
-rw-r--r-- | template/en/default/global/common-links.html.tmpl | 2 | ||||
-rw-r--r-- | template/en/default/global/field-descs.none.tmpl | 10 |
3 files changed, 14 insertions, 6 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm index ba3e75d89..b8d2e9b84 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -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(); diff --git a/template/en/default/global/common-links.html.tmpl b/template/en/default/global/common-links.html.tmpl index 4690d177a..18695a8c6 100644 --- a/template/en/default/global/common-links.html.tmpl +++ b/template/en/default/global/common-links.html.tmpl @@ -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 %]&requestee= diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl index f669df6df..7d89bd5c2 100644 --- a/template/en/default/global/field-descs.none.tmpl +++ b/template/en/default/global/field-descs.none.tmpl @@ -91,10 +91,12 @@ 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", |