From 71de03e6de4293994db999ae46f3f4352b8a7393 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 6 Nov 2007 18:25:44 +0000 Subject: [PATCH] - user web: BoincDb::get() checks if web activity is stopped, and shows an error page (or XML error) if so. svn path=/trunk/boinc/; revision=14098 --- checkin_notes | 8 ++++++++ html/inc/boinc_db.inc | 14 ++++++++++++++ html/inc/util.inc | 5 ++--- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index 8ba9744784..c0061a6b58 100644 --- a/checkin_notes +++ b/checkin_notes @@ -10513,3 +10513,11 @@ Charlie 6 Nov 2007 buildWxMac.sh boinc.xcodeproj/ project.pbxproj + +David 6 Nov 2007 + - user web: BoincDb::get() checks if web activity is stopped, + and shows an error page (or XML error) if so. + + html/inc/ + boinc_db.inc + util.inc diff --git a/html/inc/boinc_db.inc b/html/inc/boinc_db.inc index d975d50e6c..a6cdf35eac 100644 --- a/html/inc/boinc_db.inc +++ b/html/inc/boinc_db.inc @@ -7,6 +7,20 @@ class BoincDb extends DbConn { static $instance; static function get($readonly = false) { + global $generating_xml; + if (web_stopped()) { + if ($generating_xml) { + xml_error(-183); + } else { + page_head("Page not available"); + echo "This page requires database access. + Our database server is temporarily shut down for maintenance. + Please try again later. + "; + page_tail(); + } + exit(); + } if (!isset($instance)) { $config = get_config(); $user = parse_config($config, ''); diff --git a/html/inc/util.inc b/html/inc/util.inc index 1da05a5b65..53fa295db5 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -142,9 +142,8 @@ function page_tail_main($show_date=false) { page_tail_aux(false, $show_date); } -/** - * See the comments for page_head() - */ +// See the comments for page_head() +// if (!function_exists("page_tail")){ function page_tail($show_date=false, $prefix="") { page_tail_aux(true, $show_date, $prefix);