From a78bee285d610e0cd13f7ff2b360a45900e10bd3 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 14 Sep 2008 08:40:23 +0000 Subject: [PATCH] MDL-16433 themes and javascript files are not blocked by running upgrade anymore --- lib/javascript-mod.php | 1 + lib/setup.php | 4 ++-- theme/chameleon/styles.php | 4 +++- theme/colors/styles.php | 6 ++++-- theme/cornflower/styles.php | 6 ++++-- theme/custom_corners/styles.php | 6 ++++-- theme/formal_white/styles.php | 6 ++++-- theme/lines/styles.php | 8 +++++--- theme/metal/styles.php | 9 ++++++--- theme/oceanblue/styles.php | 6 ++++-- theme/orangewhite/styles.php | 9 ++++++--- theme/orangewhitepda/styles.php | 9 ++++++--- theme/standard/styles.php | 6 ++++-- theme/standardblue/styles.php | 9 ++++++--- theme/standardgreen/styles.php | 9 ++++++--- theme/standardlogo/styles.php | 9 ++++++--- theme/standardred/styles.php | 9 ++++++--- theme/standardwhite/styles.php | 9 ++++++--- theme/wood/styles.php | 9 ++++++--- 19 files changed, 89 insertions(+), 45 deletions(-) diff --git a/lib/javascript-mod.php b/lib/javascript-mod.php index 22dc0cb4b3..b48e39d752 100644 --- a/lib/javascript-mod.php +++ b/lib/javascript-mod.php @@ -4,6 +4,7 @@ /// that should be called on every page define('NO_MOODLE_COOKIES', true); + define('NO_UPGRADE_CHECK', true); include('../config.php'); diff --git a/lib/setup.php b/lib/setup.php index f408b0de9f..7fe9f98d90 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -160,8 +160,8 @@ global $HTTPSPAGEREQUIRED; /// Load up any configuration from the config table $CFG = get_config(); -/// Verify upgrade is not running - if (isset($CFG->upgraderunning)) { +/// Verify upgrade is not running unless we are in a script that needs to execute in any case + if (!defined('NO_UPGRADE_CHECK') and isset($CFG->upgraderunning)) { if ($CFG->upgraderunning < time()) { unset_config('upgraderunning'); } else { diff --git a/theme/chameleon/styles.php b/theme/chameleon/styles.php index 097d3afe22..648a960e2d 100644 --- a/theme/chameleon/styles.php +++ b/theme/chameleon/styles.php @@ -7,12 +7,14 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); diff --git a/theme/colors/styles.php b/theme/colors/styles.php index fd3271b72d..648a960e2d 100755 --- a/theme/colors/styles.php +++ b/theme/colors/styles.php @@ -7,12 +7,14 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet - $nomoodlecookie = true; // Cookies prevent caching, so don't use them + define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); diff --git a/theme/cornflower/styles.php b/theme/cornflower/styles.php index 61ff453952..19b0cc0489 100644 --- a/theme/cornflower/styles.php +++ b/theme/cornflower/styles.php @@ -7,11 +7,13 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lifetime = 1800; // Seconds to cache this stylesheet style_sheet_setup(time(), $lifetime, $themename, $forceconfig); diff --git a/theme/custom_corners/styles.php b/theme/custom_corners/styles.php index b4e33844d7..ef50a2e215 100644 --- a/theme/custom_corners/styles.php +++ b/theme/custom_corners/styles.php @@ -7,12 +7,14 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); diff --git a/theme/formal_white/styles.php b/theme/formal_white/styles.php index 097d3afe22..37a910bc9d 100644 --- a/theme/formal_white/styles.php +++ b/theme/formal_white/styles.php @@ -7,12 +7,14 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); diff --git a/theme/lines/styles.php b/theme/lines/styles.php index fd3271b72d..37a910bc9d 100755 --- a/theme/lines/styles.php +++ b/theme/lines/styles.php @@ -7,12 +7,14 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet - $nomoodlecookie = true; // Cookies prevent caching, so don't use them + define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); diff --git a/theme/metal/styles.php b/theme/metal/styles.php index e80d741485..37a910bc9d 100644 --- a/theme/metal/styles.php +++ b/theme/metal/styles.php @@ -7,12 +7,15 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 1800; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet - style_sheet_setup(time(), $lifetime, $themename, $forceconfig); + style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); ?> diff --git a/theme/oceanblue/styles.php b/theme/oceanblue/styles.php index 097d3afe22..37a910bc9d 100644 --- a/theme/oceanblue/styles.php +++ b/theme/oceanblue/styles.php @@ -7,12 +7,14 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); diff --git a/theme/orangewhite/styles.php b/theme/orangewhite/styles.php index 61ff453952..37a910bc9d 100644 --- a/theme/orangewhite/styles.php +++ b/theme/orangewhite/styles.php @@ -7,12 +7,15 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet - style_sheet_setup(time(), $lifetime, $themename, $forceconfig); + style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); ?> diff --git a/theme/orangewhitepda/styles.php b/theme/orangewhitepda/styles.php index 61ff453952..37a910bc9d 100644 --- a/theme/orangewhitepda/styles.php +++ b/theme/orangewhitepda/styles.php @@ -7,12 +7,15 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet - style_sheet_setup(time(), $lifetime, $themename, $forceconfig); + style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); ?> diff --git a/theme/standard/styles.php b/theme/standard/styles.php index 097d3afe22..37a910bc9d 100644 --- a/theme/standard/styles.php +++ b/theme/standard/styles.php @@ -7,12 +7,14 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 600; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); diff --git a/theme/standardblue/styles.php b/theme/standardblue/styles.php index e80d741485..37a910bc9d 100644 --- a/theme/standardblue/styles.php +++ b/theme/standardblue/styles.php @@ -7,12 +7,15 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 1800; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet - style_sheet_setup(time(), $lifetime, $themename, $forceconfig); + style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); ?> diff --git a/theme/standardgreen/styles.php b/theme/standardgreen/styles.php index e80d741485..37a910bc9d 100644 --- a/theme/standardgreen/styles.php +++ b/theme/standardgreen/styles.php @@ -7,12 +7,15 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 1800; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet - style_sheet_setup(time(), $lifetime, $themename, $forceconfig); + style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); ?> diff --git a/theme/standardlogo/styles.php b/theme/standardlogo/styles.php index e80d741485..37a910bc9d 100644 --- a/theme/standardlogo/styles.php +++ b/theme/standardlogo/styles.php @@ -7,12 +7,15 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 1800; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet - style_sheet_setup(time(), $lifetime, $themename, $forceconfig); + style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); ?> diff --git a/theme/standardred/styles.php b/theme/standardred/styles.php index e80d741485..37a910bc9d 100644 --- a/theme/standardred/styles.php +++ b/theme/standardred/styles.php @@ -7,12 +7,15 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 1800; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet - style_sheet_setup(time(), $lifetime, $themename, $forceconfig); + style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); ?> diff --git a/theme/standardwhite/styles.php b/theme/standardwhite/styles.php index e80d741485..37a910bc9d 100644 --- a/theme/standardwhite/styles.php +++ b/theme/standardwhite/styles.php @@ -7,12 +7,15 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 1800; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet - style_sheet_setup(time(), $lifetime, $themename, $forceconfig); + style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); ?> diff --git a/theme/wood/styles.php b/theme/wood/styles.php index e80d741485..37a910bc9d 100644 --- a/theme/wood/styles.php +++ b/theme/wood/styles.php @@ -7,12 +7,15 @@ /// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. - $lifetime = 1800; // Seconds to cache this stylesheet define('NO_MOODLE_COOKIES', true); // session not used here + define('NO_UPGRADE_CHECK', true); // ignore upgrade check + require_once("../../config.php"); // Load up the Moodle libraries - $themename = basename(dirname(__FILE__)); // Name of the folder we are in + $themename = basename(dirname(__FILE__)); // Name of the folder we are in $forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme + $lang = optional_param('lang', '', PARAM_FILE); // Look for styles in this language + $lifetime = 1800; // Seconds to cache this stylesheet - style_sheet_setup(time(), $lifetime, $themename, $forceconfig); + style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang); ?> -- 2.39.5