some fixes to the keymanager class to identify the file owner and the owner path correctly.

This commit is contained in:
Björn Schießle 2013-04-18 17:52:27 +02:00
parent fe58e4b1a6
commit 39c717b24c
1 changed files with 7 additions and 4 deletions

View File

@ -108,7 +108,8 @@ class Keymanager {
\OC_FileProxy::$enabled = false;
$util = new Util($view, $userId);
//here we need the currently logged in user, while userId can be a different user
$util = new Util($view, \OCP\User::getUser());
list($owner, $filename) = $util->getUidAndFilename($path);
$basePath = '/' . $owner . '/files_encryption/keyfiles';
@ -168,7 +169,7 @@ class Keymanager {
*/
public static function getFileKey( \OC_FilesystemView $view, $userId, $filePath ) {
$util = new Util($view, $userId);
$util = new Util($view, \OCP\User::getUser());
list($owner, $filename) = $util->getUidAndFilename($filePath);
$filePath_f = ltrim( $filename, '/' );
@ -298,7 +299,8 @@ class Keymanager {
*/
public static function setShareKey( \OC_FilesystemView $view, $path, $userId, $shareKey ) {
$util = new Util( $view, $userId );
//here we need the currently logged in user, while userId can be a different user
$util = new Util( $view, \OCP\User::getUser() );
list($owner, $filename) = $util->getUidAndFilename($path);
@ -368,7 +370,8 @@ class Keymanager {
\OC_FileProxy::$enabled = false;
$util = new Util( $view, $userId );
//here we need the currently logged in user, while userId can be a different user
$util = new Util( $view, \OCP\User::getUser() );
list($owner, $filename) = $util->getUidAndFilename($filePath);