summaryrefslogtreecommitdiffstats
path: root/lib/files
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-02-22 22:59:09 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2013-02-22 22:59:09 +0100
commit9898ba4daf1acdead2ed5fa6024e779caafb353e (patch)
tree3fc02fea4997344c73e0bc5ac7bdfc5616d7a7df /lib/files
parent5062ae250b767867609f64c29ab4cde65f022b75 (diff)
parent78fce834058a38a7dbcc5310e16095c743434bc6 (diff)
downloadnextcloud-server-9898ba4daf1acdead2ed5fa6024e779caafb353e.tar.gz
nextcloud-server-9898ba4daf1acdead2ed5fa6024e779caafb353e.zip
Merge branch 'master' into master-sqlserver
Conflicts: core/templates/installation.php
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/filesystem.php27
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 875a9d6c5ee..401ee8417e5 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -219,11 +219,14 @@ class Filesystem {
}
$parser = new \OC\ArrayParser();
+ $root = \OC_User::getHome($user);
+ self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user);
+
// Load system mount points
if (is_file(\OC::$SERVERROOT . '/config/mount.php') or is_file(\OC::$SERVERROOT . '/config/mount.json')) {
- if(is_file(\OC::$SERVERROOT . '/config/mount.json')){
+ if (is_file(\OC::$SERVERROOT . '/config/mount.json')) {
$mountConfig = json_decode(file_get_contents(\OC::$SERVERROOT . '/config/mount.json'), true);
- }elseif(is_file(\OC::$SERVERROOT . '/config/mount.php')){
+ } elseif (is_file(\OC::$SERVERROOT . '/config/mount.php')) {
$mountConfig = $parser->parsePHP(file_get_contents(\OC::$SERVERROOT . '/config/mount.php'));
}
if (isset($mountConfig['global'])) {
@@ -259,12 +262,10 @@ class Filesystem {
}
}
// Load personal mount points
- $root = \OC_User::getHome($user);
- self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user);
if (is_file($root . '/mount.php') or is_file($root . '/mount.json')) {
- if (is_file($root . '/mount.json')){
+ if (is_file($root . '/mount.json')) {
$mountConfig = json_decode(file_get_contents($root . '/mount.json'), true);
- } elseif (is_file($root . '/mount.php')){
+ } elseif (is_file($root . '/mount.php')) {
$mountConfig = $parser->parsePHP(file_get_contents($root . '/mount.php'));
}
if (isset($mountConfig['user'][$user])) {
@@ -389,21 +390,29 @@ class Filesystem {
* @param array $data from hook
*/
static public function isBlacklisted($data) {
- $blacklist = \OC_Config::getValue('blacklisted_files', array('.htaccess'));
if (isset($data['path'])) {
$path = $data['path'];
} else if (isset($data['newpath'])) {
$path = $data['newpath'];
}
if (isset($path)) {
- $filename = strtolower(basename($path));
- if (in_array($filename, $blacklist)) {
+ if (self::isFileBlacklisted($path)) {
$data['run'] = false;
}
}
}
/**
+ * @param string $filename
+ * @return bool
+ */
+ static public function isFileBlacklisted($filename) {
+ $blacklist = \OC_Config::getValue('blacklisted_files', array('.htaccess'));
+ $filename = strtolower(basename($filename));
+ return (in_array($filename, $blacklist));
+ }
+
+ /**
* following functions are equivalent to their php builtin equivalents for arguments/return values.
*/
static public function mkdir($path) {