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
path: root/apps
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-02-10 13:56:11 +0400
committerBjoern Schiessle <schiessle@owncloud.com>2014-02-10 17:51:34 +0400
commit6f5caaa87a51e447bae07a60551804139596f60f (patch)
treed423e0cd0738146de73ab99694153d9b5e62cfea /apps
parente5dac9fa240498ea8739cd1b4baabb2eeb6bf031 (diff)
refuse login as long as the initial encryption is running
Diffstat (limited to 'apps')
-rw-r--r--apps/files_encryption/hooks/hooks.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 4c4b3f2040f..83abf3ba9de 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -80,8 +80,15 @@ class Hooks {
// Check if first-run file migration has already been performed
$ready = false;
- if ($util->getMigrationStatus() === Util::MIGRATION_OPEN) {
+ $migrationStatus = $util->getMigrationStatus();
+ if ($migrationStatus === Util::MIGRATION_OPEN) {
$ready = $util->beginMigration();
+ } elseif ($migrationStatus === Util::MIGRATION_IN_PROGRESS) {
+ // refuse login as long as the initial encryption is running
+ while ($migrationStatus === Util::MIGRATION_IN_PROGRESS) {
+ sleep(60);
+ $migrationStatus = $util->getMigrationStatus();
+ }
}
// If migration not yet done