add $view as parameter for session constructor

This commit is contained in:
Björn Schießle 2013-04-10 15:08:28 +02:00
parent 109fe198c3
commit 98de385b8a
4 changed files with 10 additions and 10 deletions

View File

@ -24,8 +24,8 @@ OCP\Util::connectHook( 'OCP\Share', 'post_unshareAll', 'OCA\Encryption\Hooks', '
OCP\Util::connectHook( 'OC_Webdav_Properties', 'update', 'OCA\Encryption\Hooks', 'updateKeyfileFromClient' );
stream_wrapper_register( 'crypt', 'OCA\Encryption\Stream' );
$session = new OCA\Encryption\Session();
$view = new OC\Files\View('/');
$session = new OCA\Encryption\Session($view);
if (
! $session->getPrivateKey( \OCP\USER::getUser() )

View File

@ -63,7 +63,7 @@ class Hooks {
$privateKey = Crypt::symmetricDecryptFileContent( $encryptedKey, $params['password'] );
$session = new Session();
$session = new Session($view);
$session->setPrivateKey( $privateKey, $params['uid'] );
@ -116,8 +116,8 @@ class Hooks {
// is in use (client-side encryption does not have access to
// the necessary keys)
if ( Crypt::mode() == 'server' ) {
$session = new Session();
$view = new \OC_FilesystemView( '/' );
$session = new Session($view);
// Get existing decrypted private key
$privateKey = $session->getPrivateKey();
@ -189,7 +189,7 @@ class Hooks {
if ( $params['itemType'] === 'file' ) {
$view = new \OC_FilesystemView( '/' );
$session = new Session();
$session = new Session($view);
$userId = \OCP\User::getUser();
$util = new Util( $view, $userId );
$path = $util->fileIdToPath( $params['itemSource'] );
@ -244,7 +244,7 @@ class Hooks {
if ( $params['itemType'] === 'file' ) {
$view = new \OC_FilesystemView( '/' );
$session = new Session();
$session = new Session($view);
$userId = \OCP\User::getUser();
$util = new Util( $view, $userId );
$path = $util->fileIdToPath( $params['itemSource'] );

View File

@ -101,7 +101,7 @@ class Proxy extends \OC_FileProxy {
$userId = \OCP\USER::getUser();
$rootView = new \OC_FilesystemView( '/' );
$util = new Util( $rootView, $userId );
$session = new Session();
$session = new Session($rootView);
$fileOwner = \OC\Files\Filesystem::getOwner( $path );
$privateKey = $session->getPrivateKey();
$filePath = $util->stripUserFilesPath( $path );
@ -223,7 +223,7 @@ class Proxy extends \OC_FileProxy {
) {
// TODO use get owner to find correct location of key files for shared files
$session = new Session();
$session = new Session($view);
$privateKey = $session->getPrivateKey( $userId );
// Get the file owner so we can retrieve its keyfile

View File

@ -236,7 +236,7 @@ class Stream {
$this->getUser();
$session = new Session();
$session = new Session($this->rootView);
$privateKey = $session->getPrivateKey( $this->userId );