summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks/hooks.php
diff options
context:
space:
mode:
authorSam Tuke <samtuke@owncloud.com>2013-01-29 19:54:40 +0000
committerSam Tuke <samtuke@owncloud.com>2013-01-29 19:54:40 +0000
commitc1f20fe37a28c6f596dd55a27962d77d0ade1892 (patch)
tree9ceb64baf2b3ae2474a0c04a8967f03c7b2d3bf6 /apps/files_encryption/hooks/hooks.php
parent094213e23171c274e0c88fab02ad2c23d37217ce (diff)
downloadnextcloud-server-c1f20fe37a28c6f596dd55a27962d77d0ade1892.tar.gz
nextcloud-server-c1f20fe37a28c6f596dd55a27962d77d0ade1892.zip
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
Diffstat (limited to 'apps/files_encryption/hooks/hooks.php')
-rw-r--r--apps/files_encryption/hooks/hooks.php15
1 files changed, 11 insertions, 4 deletions
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;