From d4ea2501858ea3152697c7c458bd9ef3ec5582f0 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 26 Apr 2011 19:04:11 +0000 Subject: [PATCH] - web: eliminate double calls to page_head() svn path=/trunk/boinc/; revision=23460 --- checkin_notes | 12 +++++++++--- html/inc/util.inc | 17 +++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/checkin_notes b/checkin_notes index 3404a34599..0f28092943 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2530,7 +2530,7 @@ David 25 Apr 2011 sched/ validator.cpp -David 25 Apr 2011 +David 26 Apr 2011 - client: fix bugs in runtime estimation of jobs that have run before but are not currently running. Old: @@ -2550,13 +2550,13 @@ David 25 Apr 2011 app.cpp,h app_control.cpp -David 25 Apr 2011 +David 26 Apr 2011 - web: fix infinite recursion when project is down html/inc/ util.inc -Rom 25 Apr 2011 +Rom 26 Apr 2011 - VBOX: Begin merging the two different vbox wrappers (COM vs. Daniel's from CERN). Where possible stick with the POSIX API set and remove Windows specific code. (Example vbm_popen). @@ -2572,3 +2572,9 @@ Rom 25 Apr 2011 vm.cpp, .h win_build/ vboxwrapper.vcproj + +David 26 Apr 2011 + - web: eliminate double calls to page_head() + + html/inc/ + util.inc diff --git a/html/inc/util.inc b/html/inc/util.inc index f08c757101..3b17c887b9 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -40,6 +40,7 @@ if (!defined('SECURE_URL_BASE')) { $generating_xml = false; $caching = false; +$did_page_head = false; function send_cookie($name, $value, $permanent, $ops=false) { // the following allows independent login for projects on the same server @@ -131,9 +132,9 @@ if (!function_exists("page_head")){ function page_head( $title, $java_onload=null, $title_plain=null, $prefix="", $head_extra=null ) { - global $caching; - global $cache_control_extra; + global $caching, $cache_control_extra, $did_page_head; + $did_page_head = true; $stylesheet = URL_BASE.STYLESHEET; $rssname = PROJECT . " RSS 2.0"; $rsslink = URL_BASE."rss_main.php"; @@ -170,7 +171,6 @@ function page_head( switch($title) { //kludge case tra("Log in"): case tra("Create an account"): - case tra("Project down for maintenance"): break; default: show_login_info($prefix); @@ -720,13 +720,18 @@ function show_image($src, $title, $alt, $height=null) { } function check_web_stopped() { - global $generating_xml; + global $generating_xml, $did_page_head; if (web_stopped()) { if ($generating_xml) { xml_error(-183); } else { - page_head(tra("Project down for maintenance")); - echo tra("This page requires database access. Our database server is temporarily shut down for maintenance. Please try again later."); + if (!$did_page_head) { + page_head(tra("Project down for maintenance")); + } + echo tra( + "%1 is temporarily shut down for maintenance. Please try again later.", + PROJECT + ); page_tail(); exit(); }