]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix user specific mount configuration
authorRobin Appelman <icewind@owncloud.com>
Wed, 7 Nov 2012 13:05:45 +0000 (14:05 +0100)
committerRobin Appelman <icewind@owncloud.com>
Wed, 7 Nov 2012 13:10:06 +0000 (14:10 +0100)
lib/filesystem.php

index 21118169dae4d6882ee499c5b11235a3d7c682eb..f54cc6492e7e42dc52563366e16f34c6005baa01 100644 (file)
@@ -202,55 +202,55 @@ class OC_Filesystem{
                if($mountpoint) {
                        if(!isset(OC_Filesystem::$storages[$mountpoint])) {
                                $mount=OC_Filesystem::$mounts[$mountpoint];
-                               OC_Filesystem::$storages[$mountpoint]=OC_Filesystem::createStorage($mount['class'],$mount['arguments']);
+                               OC_Filesystem::$storages[$mountpoint]=OC_Filesystem::createStorage($mount['class'], $mount['arguments']);
                        }
                        return OC_Filesystem::$storages[$mountpoint];
                }
        }
 
        static private function loadSystemMountPoints($user) {
-               if(is_file(OC::$SERVERROOT.'/config/mount.php')) {\r
-                       $mountConfig=include(OC::$SERVERROOT.'/config/mount.php');\r
-                       if(isset($mountConfig['global'])) {\r
-                               foreach($mountConfig['global'] as $mountPoint=>$options) {\r
-                                       self::mount($options['class'],$options['options'],$mountPoint);\r
-                               }\r
-                       }\r
-               \r
-                       if(isset($mountConfig['group'])) {\r
-                               foreach($mountConfig['group'] as $group=>$mounts) {\r
-                                       if(OC_Group::inGroup($user,$group)) {\r
-                                               foreach($mounts as $mountPoint=>$options) {\r
-                                                       $mountPoint=self::setUserVars($mountPoint, $user);\r
-                                                       foreach($options as &$option) {\r
-                                                               $option=self::setUserVars($option, $user);\r
-                                                       }\r
-                                                       self::mount($options['class'],$options['options'],$mountPoint);\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-               \r
-                       if(isset($mountConfig['user'])) {\r
-                               foreach($mountConfig['user'] as $user=>$mounts) {\r
-                                       if($user==='all' or strtolower($user)===strtolower($user)) {\r
-                                               foreach($mounts as $mountPoint=>$options) {\r
-                                                       $mountPoint=self::setUserVars($mountPoint, $user);\r
-                                                       foreach($options as &$option) {\r
-                                                               $option=self::setUserVars($option, $user);\r
-                                                       }\r
-                                                       self::mount($options['class'],$options['options'],$mountPoint);\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-               \r
-                       $mtime=filemtime(OC::$SERVERROOT.'/config/mount.php');\r
-                       $previousMTime=OC_Appconfig::getValue('files','mountconfigmtime',0);\r
-                       if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated\r
-                               OC_FileCache::triggerUpdate();\r
-                               OC_Appconfig::setValue('files','mountconfigmtime',$mtime);\r
-                       }\r
+               if(is_file(OC::$SERVERROOT.'/config/mount.php')) {
+                       $mountConfig=include OC::$SERVERROOT.'/config/mount.php';
+                       if(isset($mountConfig['global'])) {
+                               foreach($mountConfig['global'] as $mountPoint=>$options) {
+                                       self::mount($options['class'], $options['options'], $mountPoint);
+                               }
+                       }
+               
+                       if(isset($mountConfig['group'])) {
+                               foreach($mountConfig['group'] as $group=>$mounts) {
+                                       if(OC_Group::inGroup($user, $group)) {
+                                               foreach($mounts as $mountPoint=>$options) {
+                                                       $mountPoint=self::setUserVars($mountPoint, $user);
+                                                       foreach($options as &$option) {
+                                                               $option=self::setUserVars($option, $user);
+                                                       }
+                                                       self::mount($options['class'], $options['options'], $mountPoint);
+                                               }
+                                       }
+                               }
+                       }
+               
+                       if(isset($mountConfig['user'])) {
+                               foreach($mountConfig['user'] as $mountUser=>$mounts) {
+                                       if($user==='all' or strtolower($mountUser)===strtolower($user)) {
+                                               foreach($mounts as $mountPoint=>$options) {
+                                                       $mountPoint=self::setUserVars($mountPoint, $user);
+                                                       foreach($options as &$option) {
+                                                               $option=self::setUserVars($option, $user);
+                                                       }
+                                                       self::mount($options['class'], $options['options'], $mountPoint);
+                                               }
+                                       }
+                               }
+                       }
+               
+                       $mtime=filemtime(OC::$SERVERROOT.'/config/mount.php');
+                       $previousMTime=OC_Appconfig::getValue('files', 'mountconfigmtime', 0);
+                       if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated
+                               OC_FileCache::triggerUpdate();
+                               OC_Appconfig::setValue('files', 'mountconfigmtime', $mtime);
+                       }
                }               
        }