diff options
author | Sam Tuke <samtuke@owncloud.com> | 2013-01-14 19:07:28 +0000 |
---|---|---|
committer | Sam Tuke <samtuke@owncloud.com> | 2013-01-14 19:07:28 +0000 |
commit | d95fc4e1e33f2e6fe4664d03bd39aa48f27e0ad8 (patch) | |
tree | e84d1c690bea16a4934a43717ba6a1388a5874da /apps/files_encryption/hooks | |
parent | 23db814cbd09e89824f6fee4fcef9e64a54c0458 (diff) | |
download | nextcloud-server-d95fc4e1e33f2e6fe4664d03bd39aa48f27e0ad8.tar.gz nextcloud-server-d95fc4e1e33f2e6fe4664d03bd39aa48f27e0ad8.zip |
Adding sharing support: added new method in Keymanager setShareKey()
Added notes in proxy{} and stream{} pointing to share support
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index c2f97247835..ecceae352bc 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -121,8 +121,11 @@ class Hooks { if ( isset( $params['properties']['key'] ) ) {
- Keymanager::setFileKey( $params['path'], $params['properties']['key'] );
-
+ $view = new \OC_FilesystemView( '/' );
+ $userId = \OCP\User::getUser();
+
+ Keymanager::setFileKey( $view, $params['path'], $userId, $params['properties']['key'] );
+
} else {
\OC_Log::write(
@@ -138,6 +141,43 @@ class Hooks { }
+ /**
+ * @brief
+ */
+ public static function postShared( $params ) {
+
+ // Delete existing catfile
+ Keymanager::deleteFileKey( );
+
+ // Generate new catfile and env keys
+ Crypt::multiKeyEncrypt( $plainContent, $publicKeys );
+
+ // Save env keys to user folders
+
+
+ }
+
+ /**
+ * @brief
+ */
+ public static function preUnshare( $params ) {
+
+ // Delete existing catfile
+
+ // Generate new catfile and env keys
+
+ // Save env keys to user folders
+ }
+
+ /**
+ * @brief
+ */
+ public static function preUnshareAll( $params ) {
+
+ trigger_error( "preUnshareAll" );
+
+ }
+
}
?>
\ No newline at end of file |