$util = new Util($view, $userId);\r
\r
// Format paths to be relative to user files dir\r
- $oldKeyfilePath = \OC\Files\Filesystem::normalizePath(\r
- $userId . '/' . 'files_encryption' . '/' . 'keyfiles' . '/' . $params['oldpath']);\r
- $newKeyfilePath = \OC\Files\Filesystem::normalizePath(\r
- $userId . '/' . 'files_encryption' . '/' . 'keyfiles' . '/' . $params['newpath']);\r
+ if ($util->isSystemWideMountPoint($params['oldpath'])) {\r
+ $baseDir = 'files_encryption/';\r
+ $oldKeyfilePath = $baseDir . 'keyfiles/' . $params['oldpath'];\r
+ } else {\r
+ $baseDir = $userId . '/' . 'files_encryption/';\r
+ $oldKeyfilePath = $baseDir . 'keyfiles/' . $params['oldpath'];\r
+ }\r
+\r
+ if ($util->isSystemWideMountPoint($params['newpath'])) {\r
+ $newKeyfilePath = $baseDir . 'keyfiles/' . $params['newpath'];\r
+ } else {\r
+ $newKeyfilePath = $baseDir . 'keyfiles/' . $params['newpath'];\r
+ }\r
\r
// add key ext if this is not an folder\r
if (!$view->is_dir($oldKeyfilePath)) {\r
$newKeyfilePath .= '.key';\r
\r
// handle share-keys\r
- $localKeyPath = $view->getLocalFile($userId . '/files_encryption/share-keys/' . $params['oldpath']);\r
+ $localKeyPath = $view->getLocalFile($baseDir . 'share-keys/' . $params['oldpath']);\r
$matches = glob(preg_quote($localKeyPath) . '*.shareKey');\r
foreach ($matches as $src) {\r
$dst = \OC\Files\Filesystem::normalizePath(str_replace($params['oldpath'], $params['newpath'], $src));\r
\r
} else {\r
// handle share-keys folders\r
- $oldShareKeyfilePath = \OC\Files\Filesystem::normalizePath(\r
- $userId . '/' . 'files_encryption' . '/' . 'share-keys' . '/' . $params['oldpath']);\r
- $newShareKeyfilePath = \OC\Files\Filesystem::normalizePath(\r
- $userId . '/' . 'files_encryption' . '/' . 'share-keys' . '/' . $params['newpath']);\r
+ $oldShareKeyfilePath = $baseDir . 'share-keys/' . $params['oldpath'];\r
+ $newShareKeyfilePath = $baseDir . 'share-keys/' . $params['newpath'];\r
\r
// create destination folder if not exists\r
if (!$view->file_exists(dirname($newShareKeyfilePath))) {\r