]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add a copied_sample_config switch
authorLukas Reschke <lukas@owncloud.com>
Wed, 13 Aug 2014 22:06:19 +0000 (00:06 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 19 Aug 2014 07:57:03 +0000 (09:57 +0200)
Hopefully this will stop people from copying the sample config. I'm so annoyed by all those wrong bug reports...

Add some explanation about this switch

Move check to init

config/config.sample.php
lib/base.php

index 1cf2c22866a7bc023de8ad6515cc80f616258c03..33e16f4710bccaf3645cd821aa41d3243d877682 100755 (executable)
@@ -172,6 +172,10 @@ $CONFIG = array(
 /* File for the owncloud logger to log to, (default is ownloud.log in the data dir) */
 "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" => "",
 
index 99c2764d22c8db9841ce5d810a4d4101c0533d8d..9dd50d7b4cf893590b6e0ef09a02c9ac97e910a2 100644 (file)
@@ -574,6 +574,18 @@ class OC {
                                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() {