summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-04-10 15:08:28 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-04-10 15:08:28 +0200
commit98de385b8adf748bc1f7d9b527b253624575e370 (patch)
tree989dee0fcc8480897615dab49b56fd16f2b9eea0 /apps/files_encryption
parent109fe198c3b8ffd5a4f7f4a4aba6639480895644 (diff)
downloadnextcloud-server-98de385b8adf748bc1f7d9b527b253624575e370.tar.gz
nextcloud-server-98de385b8adf748bc1f7d9b527b253624575e370.zip
add $view as parameter for session constructor
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/appinfo/app.php4
-rw-r--r--apps/files_encryption/hooks/hooks.php10
-rw-r--r--apps/files_encryption/lib/proxy.php4
-rw-r--r--apps/files_encryption/lib/stream.php2
4 files changed, 10 insertions, 10 deletions
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index b095f79c0c3..47f4120fb35 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -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() )
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 43d3dfb5a6a..82de80a1cf4 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -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'] );
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index d5aa0f74f11..7e18ec9b104 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -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
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index 9d01c2ca6c5..8bacb981268 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -236,7 +236,7 @@ class Stream {
$this->getUser();
- $session = new Session();
+ $session = new Session($this->rootView);
$privateKey = $session->getPrivateKey( $this->userId );