]> source.dussan.org Git - nextcloud-server.git/commitdiff
move isSystemWideMountPoint() to util.php
authorBjörn Schießle <schiessle@owncloud.com>
Tue, 25 Jun 2013 12:25:00 +0000 (14:25 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Fri, 5 Jul 2013 13:59:29 +0000 (15:59 +0200)
apps/files_encryption/lib/keymanager.php
apps/files_encryption/lib/util.php

index 898ea945a6886836e26ecf57c51c47fb6c8be060..d43a0c28918d89fd294198726e3702d09fc74b4a 100755 (executable)
@@ -127,7 +127,7 @@ class Keymanager {
                list($owner, $filename) = $util->getUidAndFilename($path);
 
                // in case of system wide mount points the keys are stored directly in the data directory
-               if (self::isSystemWideMountPoint($filename)) {
+               if ($util->isSystemWideMountPoint($filename)) {
                        $basePath = '/files_encryption/keyfiles';
                } else {
                        $basePath = '/' . $owner . '/files_encryption/keyfiles';
@@ -239,7 +239,7 @@ class Keymanager {
                $filePath_f = ltrim($filename, '/');
 
                // in case of system wide mount points the keys are stored directly in the data directory
-               if (self::isSystemWideMountPoint($filename)) {
+               if ($util->isSystemWideMountPoint($filename)) {
                        $keyfilePath = '/files_encryption/keyfiles/' . $filePath_f . '.key';
                } else {
                        $keyfilePath = '/' . $owner . '/files_encryption/keyfiles/' . $filePath_f . '.key';
@@ -374,7 +374,7 @@ class Keymanager {
                list($owner, $filename) = $util->getUidAndFilename($path);
 
                // in case of system wide mount points the keys are stored directly in the data directory
-               if (self::isSystemWideMountPoint($filename)) {
+               if ($util->isSystemWideMountPoint($filename)) {
                        $basePath = '/files_encryption/share-keys';
                } else {
                        $basePath = '/' . $owner . '/files_encryption/share-keys';
@@ -438,7 +438,7 @@ class Keymanager {
                list($owner, $filename) = $util->getUidAndFilename($filePath);
 
                // in case of system wide mount points the keys are stored directly in the data directory
-               if (self::isSystemWideMountPoint($filename)) {
+               if ($util->isSystemWideMountPoint($filename)) {
                        $shareKeyPath = '/files_encryption/share-keys/' . $filename . '.' . $userId . '.shareKey';
                } else {
                        $shareKeyPath = '/' . $owner . '/files_encryption/share-keys/' . $filename . '.' . $userId . '.shareKey';
@@ -569,19 +569,4 @@ class Keymanager {
                return $targetPath;
 
        }
-
-       /**
-        * @brief check if the file is stored on a system wide mount point
-        * @param $path relative to /data/user with leading '/'
-        * @return boolean
-        */
-       private static function isSystemWideMountPoint($path) {
-               $mount = \OC_Mount_Config::getSystemMountPoints();
-               foreach ($mount as $mountPoint => $data) {
-                       if ($mountPoint == substr($path, 1, strlen($mountPoint))) {
-                               return true;
-                       }
-               }
-               return false;
-       }
 }
\ No newline at end of file
index 2bf17dcc2236226b0a5e3991c26e866184b8d4a8..7228d2a64791274e23fc066fb260d4c17c50113d 100644 (file)
@@ -1561,4 +1561,19 @@ class Util {
                return $relativePath;
        }
 
+       /**
+        * @brief check if the file is stored on a system wide mount point
+        * @param $path relative to /data/user with leading '/'
+        * @return boolean
+        */
+       public function isSystemWideMountPoint($path) {
+               $mount = \OC_Mount_Config::getSystemMountPoints();
+               foreach ($mount as $mountPoint => $data) {
+                       if ($mountPoint == substr($path, 1, strlen($mountPoint))) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
 }