From b5fad75e579b9aeada87e63b4e7866956e1e20ff Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Fri, 27 Mar 2015 11:46:32 +0100
Subject: [PATCH] add deleteAllFileKeys to public interface and add "uid" as
 parameter for the update call

---
 lib/private/encryption/update.php           | 2 +-
 lib/public/encryption/iencryptionmodule.php | 3 ++-
 lib/public/encryption/keys/istorage.php     | 8 ++++++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/private/encryption/update.php b/lib/private/encryption/update.php
index 649cf0285a..06dc330151 100644
--- a/lib/private/encryption/update.php
+++ b/lib/private/encryption/update.php
@@ -104,7 +104,7 @@ class Update {
 
 			foreach ($allFiles as $path) {
 				$usersSharing = $this->util->getSharingUsersArray($path);
-				$encryptionModule->update($absPath, $usersSharing);
+				$encryptionModule->update($absPath, $this->uid, $usersSharing);
 			}
 	}
 
diff --git a/lib/public/encryption/iencryptionmodule.php b/lib/public/encryption/iencryptionmodule.php
index 2527e35e63..7265fee125 100644
--- a/lib/public/encryption/iencryptionmodule.php
+++ b/lib/public/encryption/iencryptionmodule.php
@@ -84,10 +84,11 @@ interface IEncryptionModule {
 	 * update encrypted file, e.g. give additional users access to the file
 	 *
 	 * @param string $path path to the file which should be updated
+	 * @param string $uid of the user who performs the operation
 	 * @param array $accessList who has access to the file contains the key 'users' and 'public'
 	 * @return boolean
 	 */
-	public function update($path, $accessList);
+	public function update($path, $uid, $accessList);
 
 	/**
 	 * should the file be encrypted or not
diff --git a/lib/public/encryption/keys/istorage.php b/lib/public/encryption/keys/istorage.php
index 24f6efd6e5..4c2b01f4ad 100644
--- a/lib/public/encryption/keys/istorage.php
+++ b/lib/public/encryption/keys/istorage.php
@@ -104,6 +104,14 @@ interface IStorage {
 	 */
 	public function deleteFileKey($path, $keyId);
 
+	/**
+	 * delete all file keys for a given file
+	 *
+	 * @param string $path to the file
+	 * @return boolean
+	 */
+	public function deleteAllFileKeys($path);
+
 	/**
 	 * delete system-wide encryption keys not related to a specific user,
 	 * e.g something like a key for public link shares
-- 
GitLab