summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/keymanager.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-11-21 00:23:38 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2013-11-21 00:23:38 +0100
commitb27fc42e1f0fbd1edebb1eb1818de4b4e0c4ee4b (patch)
tree6e66949a72e8471a01817ff05851b65aec6ef8f0 /apps/files_encryption/lib/keymanager.php
parent318db64b2d9f724c3209bd6ca97f560840e2cc20 (diff)
downloadnextcloud-server-b27fc42e1f0fbd1edebb1eb1818de4b4e0c4ee4b.tar.gz
nextcloud-server-b27fc42e1f0fbd1edebb1eb1818de4b4e0c4ee4b.zip
public upload now also works with encryption enabled
Diffstat (limited to 'apps/files_encryption/lib/keymanager.php')
-rwxr-xr-xapps/files_encryption/lib/keymanager.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php
index b207b1437ba..b4396864a49 100755
--- a/apps/files_encryption/lib/keymanager.php
+++ b/apps/files_encryption/lib/keymanager.php
@@ -112,6 +112,7 @@ class Keymanager {
* @brief store file encryption key
*
* @param \OC_FilesystemView $view
+ * @param \OCA\Encryption\Util $util
* @param string $path relative path of the file, including filename
* @param $userId
* @param $catfile
@@ -120,13 +121,11 @@ class Keymanager {
* @note The keyfile is not encrypted here. Client code must
* asymmetrically encrypt the keyfile before passing it to this method
*/
- public static function setFileKey(\OC_FilesystemView $view, $path, $userId, $catfile) {
+ public static function setFileKey(\OC_FilesystemView $view, $util, $path, $userId, $catfile) {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
- $userId = Helper::getUser($path);
- $util = new Util($view, $userId);
list($owner, $filename) = $util->getUidAndFilename($path);
// in case of system wide mount points the keys are stored directly in the data directory
@@ -315,19 +314,16 @@ class Keymanager {
/**
* @brief store multiple share keys for a single file
* @param \OC_FilesystemView $view
- * @param $path
+ * @param \OCA\Encryption\Util $util
+ * @param string $path
* @param array $shareKeys
* @return bool
*/
- public static function setShareKeys(\OC_FilesystemView $view, $path, array $shareKeys) {
+ public static function setShareKeys(\OC_FilesystemView $view, $util, $path, array $shareKeys) {
// $shareKeys must be an array with the following format:
// [userId] => [encrypted key]
- $userId = Helper::getUser($path);
-
- $util = new Util($view, $userId);
-
list($owner, $filename) = $util->getUidAndFilename($path);
// in case of system wide mount points the keys are stored directly in the data directory