$mp1 = $view->getMountPoint('/' . $user . '/files/' . $params['oldpath']);\r
$mp2 = $view->getMountPoint('/' . $user . '/files/' . $params['newpath']);\r
\r
- if ($mp1 === $mp2) {\r
-\r
- $oldKeysPath = Keymanager::getKeyPath($view, $util, $params['oldpath']);\r
+ $oldKeysPath = Keymanager::getKeyPath($view, $util, $params['oldpath']);\r
\r
+ if ($mp1 === $mp2) {\r
self::$renamedFiles[$params['oldpath']] = array(\r
'operation' => $operation,\r
'oldKeysPath' => $oldKeysPath,\r
);\r
-\r
+ } else {\r
+ self::$renamedFiles[$params['oldpath']] = array(\r
+ 'operation' => 'cleanup',\r
+ 'oldKeysPath' => $oldKeysPath,\r
+ );\r
}\r
}\r
\r
$operation = self::$renamedFiles[$params['oldpath']]['operation'];\r
$oldKeysPath = self::$renamedFiles[$params['oldpath']]['oldKeysPath'];\r
unset(self::$renamedFiles[$params['oldpath']]);\r
+ if ($operation === 'cleanup') {\r
+ return $view->unlink($oldKeysPath);\r
+ }\r
} else {\r
\OCP\Util::writeLog('Encryption library', "can't get path and owner from the file before it was renamed", \OCP\Util::DEBUG);\r
return false;\r