From fc116f563fec20447e7300605d940cada975154c Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 25 Nov 2014 16:12:12 +0100 Subject: Allow read-only configuration Workaround required for IIS setups running ownCloud to prevent dataloss. Long-term solution would be to move some configuration settings to the database --- lib/base.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/base.php') diff --git a/lib/base.php b/lib/base.php index 82c0c7aa6d0..0c9dbb30a73 100644 --- a/lib/base.php +++ b/lib/base.php @@ -194,9 +194,9 @@ class OC { public static function checkConfig() { $l = \OC::$server->getL10N('lib'); - if (file_exists(self::$configDir . "/config.php") - and !is_writable(self::$configDir . "/config.php") - ) { + $configFileWritable = file_exists(self::$configDir . "/config.php") && is_writable(self::$configDir . "/config.php"); + if (!$configFileWritable && !OC_Helper::isReadOnlyConfigEnabled() + || !$configFileWritable && \OCP\Util::needUpgrade()) { if (self::$CLI) { echo $l->t('Cannot write into "config" directory!')."\n"; echo $l->t('This can usually be fixed by giving the webserver write access to the config directory')."\n"; -- cgit v1.2.3