]> source.dussan.org Git - nextcloud-server.git/commitdiff
get the correct paths and owner to access shared files
authorBjörn Schießle <schiessle@owncloud.com>
Tue, 26 Mar 2013 11:40:31 +0000 (12:40 +0100)
committerBjörn Schießle <schiessle@owncloud.com>
Tue, 26 Mar 2013 11:40:31 +0000 (12:40 +0100)
apps/files_encryption/lib/proxy.php

index 4dc2bfd7491b5fc712867bab32cedc3dec537cd3..7c981d4fc44f9cb59567ee698206e4e33ba56e90 100644 (file)
@@ -227,11 +227,10 @@ class Proxy extends \OC_FileProxy {
                        $privateKey = $session->getPrivateKey( $userId );
                        
                        // Get the file owner so we can retrieve its keyfile
-                       $fileOwner = \OC\Files\Filesystem::getOwner( $relPath ); //NOTE: This might be false! make sure the path passed to it is right
-                       $fileOwner = 'admin'; // FIXME: Manually set the correct UID for now
-                       
+                       list($fileOwner, $ownerPath) = $util->getUidAndFilename($relPath);
+
                        // Get the encrypted keyfile
-                       $encKeyfile = Keymanager::getFileKey( $view, $fileOwner, $relPath );
+                       $encKeyfile = Keymanager::getFileKey( $view, $fileOwner, $ownerPath );
                        
                        // Attempt to fetch the user's shareKey
                        $shareKey = Keymanager::getShareKey( $view, $userId, $relPath );