From c1f20fe37a28c6f596dd55a27962d77d0ade1892 Mon Sep 17 00:00:00 2001 From: Sam Tuke Date: Tue, 29 Jan 2013 19:54:40 +0000 Subject: Made encyrption keyfiles be deleted when their parents are Made encryption keyfiles be renamed when their parents are Fixed bugs with encryptAll() execution on login --- apps/files_encryption/hooks/hooks.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'apps/files_encryption/hooks/hooks.php') diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 73d7957541a..dafa14fc000 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -37,8 +37,6 @@ class Hooks { * @note This method should never be called for users using client side encryption */ public static function login( $params ) { - - // TODO: use lots of dependency injection here $view = new \OC_FilesystemView( '/' ); @@ -83,8 +81,17 @@ class Hooks { // Encrypt existing user files: // This serves to upgrade old versions of the encryption - // app (see appinfo/spec.txt - $this->encryptAll( $publicKey, $this->userFilesDir, $session->getLegacyKey(), $params['password'] ); + // app (see appinfo/spec.txt) + if ( + $util->encryptAll( $publicKey, '/' . $params['uid'] . '/' . 'files', $session->getLegacyKey(), $params['password'] ) + ) { + + \OC_Log::write( + 'Encryption library', 'Encryption of file belonging to "' . $params['uid'] . '" was started at login' + , \OC_Log::INFO + ); + + } return true; -- cgit v1.2.3