diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-06-25 14:25:00 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-07-05 15:59:29 +0200 |
commit | eb2587a08ffc53efe284a06832f0a946d17aebf1 (patch) | |
tree | 3ff47623b7d32127f7948d4858dd504d374ff69f /apps/files_encryption | |
parent | f2de4cb3422742e7c5c91f6bcd8c2024393bbd58 (diff) | |
download | nextcloud-server-eb2587a08ffc53efe284a06832f0a946d17aebf1.tar.gz nextcloud-server-eb2587a08ffc53efe284a06832f0a946d17aebf1.zip |
move isSystemWideMountPoint() to util.php
Diffstat (limited to 'apps/files_encryption')
-rwxr-xr-x | apps/files_encryption/lib/keymanager.php | 23 | ||||
-rw-r--r-- | apps/files_encryption/lib/util.php | 15 |
2 files changed, 19 insertions, 19 deletions
diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php index 898ea945a68..d43a0c28918 100755 --- a/apps/files_encryption/lib/keymanager.php +++ b/apps/files_encryption/lib/keymanager.php @@ -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 diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index 2bf17dcc223..7228d2a6479 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -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; + } + } |