Commit b453aa6c authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Add warning at top of screen when in testing mode

Change-Id: I8523ec5c780e1e55a4e6cf82904da44036c07ca7
Signed-off-by: default avatarHugh Davenport <>
parent a9c42fc6
......@@ -95,4 +95,9 @@ $cfg->emailcontact = '';
// There are up to 20 alternate salts
// $cfg->passwordsaltalt1 = 'old salt value';
// Uncomment the following line if this server is not a production system.
// This will put a line up the top of the page saying that it isn't a production
// site, and that files may not be present.
//$cfg->productionmode = false;
// closing php tag intentionally omitted to prevent whitespace issues
......@@ -142,3 +142,5 @@ $string['gdlibrarylackspngsupport'] = 'The installed PHP GD Library does not sup
$string['nopasswordsaltset'] = 'No site-wide password salt has been set. Edit your config.php and set the "passwordsaltmain" parameter to a reasonable secret phrase.';
$string['passwordsaltweak'] = 'Your site-wide password salt is not strong enough. Edit your config.php and set the "passwordsaltmain" parameter to a longer secret phrase.';
$string['notproductionsite'] = 'This site is not in production mode. Some data may not be available and/or may be out of date';
......@@ -266,3 +266,8 @@ $cfg->renamecopies = true;
$cfg->favicondisplay = '';
// $cfg->favicondisplay = '';
// $cfg->favicondisplay = '';
// If false, a message is shown at the top of the screen saying that the
// site is not in production mode, and that some data may be missing and/or
// out of date
$cfg->productionmode = true;
......@@ -398,8 +398,14 @@ EOF;
$smarty->assign('PAGETITLE', $sitename);
if (!get_config('productionmode')) {
$sitetop = '<div class="error">' . get_string('notproductionsite', 'error') . '</div>';
if (function_exists('local_header_top_content')) {
$smarty->assign('SITETOP', local_header_top_content());
$sitetop .= local_header_top_content();
if (isset($sitetop)) {
$smarty->assign('SITETOP', $sitetop);
if (defined('PUBLIC')) {
$smarty->assign('PUBLIC', true);
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