]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix removing personal mounts
authorMichael Gapczynski <GapczynskiM@gmail.com>
Fri, 22 Jun 2012 16:22:19 +0000 (12:22 -0400)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Fri, 22 Jun 2012 16:22:42 +0000 (12:22 -0400)
apps/files_external/lib/config.php

index 870c13b5aed03ae799f4178a1a70fad302ae1953..5b9e00a3783aa6d8b1eea943d12ba3c6d12c75db 100755 (executable)
@@ -157,12 +157,17 @@ class OC_Mount_Config {
        */
        public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) {
                // Verify that the mount point applies for the current user
-               if ($isPersonal && $applicable != OCP\User::getUser()) {
-                       return false;
+               if ($isPersonal) {
+                       if ($applicable != OCP\User::getUser()) {
+                               return false;
+                       }
+                       $mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/');
+               } else {
+                       $mountPoint = '/$user/files/'.ltrim($mountPoint, '/');
                }
                $mountPoints = self::readData($isPersonal);
                // Remove mount point
-               unset($mountPoints[$mountType][$applicable]['/$user/files/'.$mountPoint]);
+               unset($mountPoints[$mountType][$applicable][$mountPoint]);
                // Unset parent arrays if empty
                if (empty($mountPoints[$mountType][$applicable])) {
                        unset($mountPoints[$mountType][$applicable]);