aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-02-10 10:56:11 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2014-02-10 10:56:11 +0100
commit050e84a08fa8eee14e52f4dbbee572596ba002ce (patch)
tree76df7f7ae68ce14735d575ee1071238bf4ad614b
parent91254c304d454b6f7977037dbd5dd2db5e00ff9f (diff)
downloadnextcloud-server-050e84a08fa8eee14e52f4dbbee572596ba002ce.tar.gz
nextcloud-server-050e84a08fa8eee14e52f4dbbee572596ba002ce.zip
refuse login as long as the initial encryption is running
-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