]> source.dussan.org Git - nextcloud-server.git/commitdiff
Revert "Added extra checks for ext storage class"
authorVincent Petry <pvince81@owncloud.com>
Thu, 20 Feb 2014 09:01:49 +0000 (10:01 +0100)
committerVincent Petry <pvince81@owncloud.com>
Thu, 20 Feb 2014 09:01:49 +0000 (10:01 +0100)
This reverts commit 9e9a5b9ea1f9b4699cf2d0c621f3f911f3639df9.

Unit tests weren't ready, need further tweaking.

apps/files_external/lib/config.php
apps/files_external/tests/mountconfig.php

index cd3e7f3a4a6703e48370f8413474139437ad6497..94dc5fb7ad877ca1243795c1fa9a30b2fcccfeb1 100755 (executable)
@@ -277,21 +277,15 @@ class OC_Mount_Config {
                                                                                 $mountType,
                                                                                 $applicable,
                                                                                 $isPersonal = false) {
-               $backends = self::getBackends();
                $mountPoint = OC\Files\Filesystem::normalizePath($mountPoint);
                if ($mountPoint === '' || $mountPoint === '/' || $mountPoint == '/Shared') {
                        // can't mount at root or "Shared" folder
                        return false;
                }
-
-               if (!isset($backends[$class])) {
-                       // invalid backend
-                       return false;
-               }       
                if ($isPersonal) {
                        // Verify that the mount point applies for the current user
                        // Prevent non-admin users from mounting local storage
-                       if ($applicable !== OCP\User::getUser() || strtolower($class) === '\oc\files\storage\local') {
+                       if ($applicable != OCP\User::getUser() || $class == '\OC\Files\Storage\Local') {
                                return false;
                        }
                        $mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/');
index 4c61b8961f3bea722e9711f2e5c5a6081e50369e..941aec680bbb1be0794a1ec7579498d8d8a248df 100644 (file)
@@ -48,28 +48,4 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
                $this->assertEquals(false, OC_Mount_Config::addMountPoint('/Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
 
        }
-
-       public function testAddMountPointSingleUser() {
-               \OC_User::setUserId('test');
-               $mountType = 'user';
-               $applicable = 'test';
-               $isPersonal = true;
-               // local
-               $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\storage\local', array(), $mountType, $applicable, $isPersonal));
-               // non-local
-               $this->assertEquals(true, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\Storage\SFTP', array(), $mountType, $applicable, $isPersonal));
-
-       }
-
-       public function testAddMountPointUnexistClass() {
-               \OC_User::setUserId('test');
-               $storageClass = 'Unexist_Storage';
-               $mountType = 'user';
-               $applicable = 'test';
-               $isPersonal = true;
-               // local
-               // non-local
-               $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', $storageClass, array(), $mountType, $applicable, $isPersonal));
-
-       }
 }