Commit b8ec302b authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 398075: Bugzilla should be able to display the "shutdownhtml" message even…

Bug 398075: Bugzilla should be able to display the "shutdownhtml" message even if the SQL server is down - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent bea6f25d
......@@ -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();
......
......@@ -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=
......
......@@ -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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment