diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-02-10 13:56:11 +0400 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-02-10 17:51:34 +0400 |
commit | 6f5caaa87a51e447bae07a60551804139596f60f (patch) | |
tree | d423e0cd0738146de73ab99694153d9b5e62cfea /apps | |
parent | e5dac9fa240498ea8739cd1b4baabb2eeb6bf031 (diff) |
refuse login as long as the initial encryption is running
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 9 |
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
|