summaryrefslogtreecommitdiffstats
path: root/lib/private/util.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-09-08 15:05:57 +0200
committerRobin Appelman <icewind@owncloud.com>2014-09-18 13:33:13 +0200
commit23dd7cb51d392d2d6fb82b55c5f51a6bf6e93733 (patch)
treeeb3d490458402de53f95dce643faca01c5c16038 /lib/private/util.php
parent6fa3280c2a4033e99b867440ae49932390784c48 (diff)
downloadnextcloud-server-23dd7cb51d392d2d6fb82b55c5f51a6bf6e93733.tar.gz
nextcloud-server-23dd7cb51d392d2d6fb82b55c5f51a6bf6e93733.zip
Don't complain about non-writable datadirs before we're installed
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-xlib/private/util.php36
1 files changed, 19 insertions, 17 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index 04f00f42447..a9c4cc70a0e 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -463,26 +463,28 @@ class OC_Util {
);
}
}
-
- if (!is_dir($CONFIG_DATADIRECTORY)) {
- $success = @mkdir($CONFIG_DATADIRECTORY);
- if ($success) {
- $errors = array_merge($errors, self::checkDataDirectoryPermissions($CONFIG_DATADIRECTORY));
- } else {
+ // Create root dir.
+ if ($config->getSystemValue('installed', false)) {
+ if (!is_dir($CONFIG_DATADIRECTORY)) {
+ $success = @mkdir($CONFIG_DATADIRECTORY);
+ if ($success) {
+ $errors = array_merge($errors, self::checkDataDirectoryPermissions($CONFIG_DATADIRECTORY));
+ } else {
+ $errors[] = array(
+ 'error' => $l->t('Cannot create "data" directory (%s)', array($CONFIG_DATADIRECTORY)),
+ 'hint' => $l->t('This can usually be fixed by '
+ . '<a href="%s" target="_blank">giving the webserver write access to the root directory</a>.',
+ array(OC_Helper::linkToDocs('admin-dir_permissions')))
+ );
+ }
+ } else if (!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) {
$errors[] = array(
- 'error' => $l->t('Cannot create "data" directory (%s)', array($CONFIG_DATADIRECTORY)),
- 'hint' => $l->t('This can usually be fixed by '
- . '<a href="%s" target="_blank">giving the webserver write access to the root directory</a>.',
- array(OC_Helper::linkToDocs('admin-dir_permissions')))
+ 'error' => 'Data directory (' . $CONFIG_DATADIRECTORY . ') not writable by ownCloud',
+ 'hint' => $permissionsHint
);
+ } else {
+ $errors = array_merge($errors, self::checkDataDirectoryPermissions($CONFIG_DATADIRECTORY));
}
- } else if (!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) {
- $errors[] = array(
- 'error' => 'Data directory (' . $CONFIG_DATADIRECTORY . ') not writable by ownCloud',
- 'hint' => $permissionsHint
- );
- } else {
- $errors = array_merge($errors, self::checkDataDirectoryPermissions($CONFIG_DATADIRECTORY));
}
if (!OC_Util::isSetLocaleWorking()) {