Merge pull request #10409 from owncloud/iShallNotCopyStuffWithoutThinking

Add a copied_sample_config switch
This commit is contained in:
Lukas Reschke 2014-08-19 11:03:57 +02:00
commit fdb203ff1e
2 changed files with 16 additions and 0 deletions

View File

@ -172,6 +172,10 @@ $CONFIG = array(
/* File for the owncloud logger to log to, (default is ownloud.log in the data dir) */ /* File for the owncloud logger to log to, (default is ownloud.log in the data dir) */
"logfile" => "", "logfile" => "",
/* This entry is just here to show a warning in case somebody copied the sample configuration. DO NOT ADD THIS SWITCH TO YOUR CONFIGURATION! */
/* If you, brave person, have read until here be aware that you should not modify *ANY* settings in this file without reading the documentation */
"copied_sample_config" => true,
/* Loglevel to start logging at. 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR (default is WARN) */ /* Loglevel to start logging at. 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR (default is WARN) */
"loglevel" => "", "loglevel" => "",

View File

@ -567,6 +567,18 @@ class OC {
OC_Util::addScript('backgroundjobs'); OC_Util::addScript('backgroundjobs');
} }
} }
// Check whether the sample configuration has been copied
if(OC_Config::getValue('copied_sample_config', false)) {
$l = \OC_L10N::get('lib');
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
OC_Template::printErrorPage(
$l->t('Sample configuration detected'),
$l->t('It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php')
);
return;
}
} }
private static function registerLocalAddressBook() { private static function registerLocalAddressBook() {