Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-06-13 15:17:35 +0400
committerBjörn Schießle <schiessle@owncloud.com>2013-06-13 15:17:35 +0400
commit7cfb0dc406910f66eaefc8651fd655a78883f241 (patch)
treea8cda865f793d21f8248c5035c363ee3971fdd1a /apps/files_encryption/hooks
parent20ddd6e1c77224d18d5be74101b80144b7187475 (diff)
parentdd8011925acbd701de10e604b377c3d7f01aeff8 (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.php11
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();
}