diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-09-25 14:32:32 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-09-25 14:32:32 +0200 |
commit | 9fc23e1967371d3765f24d74339704df77e29606 (patch) | |
tree | 842624b0581fa98958cff530b65b06c05acb0cbe /lib/private/setup.php | |
parent | f46e49529fed8cb60ff846bb959b2f564b14bea6 (diff) | |
parent | 6ff29f3874cac3c263c255b2c36cda5b8a1c67f1 (diff) | |
download | nextcloud-server-9fc23e1967371d3765f24d74339704df77e29606.tar.gz nextcloud-server-9fc23e1967371d3765f24d74339704df77e29606.zip |
Merge pull request #10934 from owncloud/datadir-write-setup
Don't complain about non-writable datadirs before we're installed
Diffstat (limited to 'lib/private/setup.php')
-rw-r--r-- | lib/private/setup.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/private/setup.php b/lib/private/setup.php index ccf996460d0..b1b3388f81b 100644 --- a/lib/private/setup.php +++ b/lib/private/setup.php @@ -37,18 +37,28 @@ class OC_Setup { $dbtype = 'sqlite'; } + $username = htmlspecialchars_decode($options['adminlogin']); + $password = htmlspecialchars_decode($options['adminpass']); + $datadir = htmlspecialchars_decode($options['directory']); + $class = self::$dbSetupClasses[$dbtype]; + /** @var \OC\Setup\AbstractDatabase $dbSetup */ $dbSetup = new $class(self::getTrans(), 'db_structure.xml'); $error = array_merge($error, $dbSetup->validate($options)); + // validate the data directory + if ( + (!is_dir($datadir) and !mkdir($datadir)) or + !is_writable($datadir) + ) { + $error[] = $l->t("Can't create or write into the data directory %s", array($datadir)); + } + if(count($error) != 0) { return $error; } //no errors, good - $username = htmlspecialchars_decode($options['adminlogin']); - $password = htmlspecialchars_decode($options['adminpass']); - $datadir = htmlspecialchars_decode($options['directory']); if( isset($options['trusted_domains']) && is_array($options['trusted_domains'])) { $trustedDomains = $options['trusted_domains']; |