aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-09-21 23:40:40 +0000
committerlpsolit%gmail.com <>2008-09-21 23:40:40 +0000
commitb8ec302b3a99b54f5838e497adb1cabe3f2f15dd (patch)
treee33219c188490606f9661fb46fc102f27b43a78a /Bugzilla.pm
parentBug 455814: token.cgi should reject password change requests for disabled acc... (diff)
downloadbugzilla-b8ec302b3a99b54f5838e497adb1cabe3f2f15dd.tar.gz
bugzilla-b8ec302b3a99b54f5838e497adb1cabe3f2f15dd.tar.bz2
bugzilla-b8ec302b3a99b54f5838e497adb1cabe3f2f15dd.zip
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
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm8
1 files changed, 7 insertions, 1 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();