diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-06-13 15:17:35 +0400 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-06-13 15:17:35 +0400 |
commit | 7cfb0dc406910f66eaefc8651fd655a78883f241 (patch) | |
tree | a8cda865f793d21f8248c5035c363ee3971fdd1a /apps/files_encryption/hooks | |
parent | 20ddd6e1c77224d18d5be74101b80144b7187475 (diff) | |
parent | dd8011925acbd701de10e604b377c3d7f01aeff8 (diff) |
Merge branch 'master' into files_encryption_check_private_key
Conflicts:
apps/files_encryption/appinfo/app.php
apps/files_encryption/lib/util.php
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 4434df8f147..7698b95cfd3 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -72,10 +72,13 @@ class Hooks { $session->setPrivateKey($privateKey);
// Check if first-run file migration has already been performed
- $migrationCompleted = $util->getMigrationStatus();
+ $ready = false;
+ if ($util->getMigrationStatus() === Util::MIGRATION_OPEN) {
+ $ready = $util->beginMigration();
+ }
// If migration not yet done
- if (!$migrationCompleted) {
+ if ($ready) {
$userView = new \OC_FilesystemView('/' . $params['uid']);
@@ -86,7 +89,7 @@ class Hooks { && $encLegacyKey = $userView->file_get_contents('encryption.key')
) {
- $plainLegacyKey = Crypt::legacyBlockDecrypt($encLegacyKey, $params['password']);
+ $plainLegacyKey = Crypt::legacyDecrypt($encLegacyKey, $params['password']);
$session->setLegacyKey($plainLegacyKey);
@@ -107,7 +110,7 @@ class Hooks { }
// Register successful migration in DB
- $util->setMigrationStatus(1);
+ $util->finishMigration();
}
|