diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2014-02-10 13:25:39 +0100 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2014-02-10 13:25:39 +0100 |
commit | 02bdb470498fb8b71f1bc582af2f55795a719c39 (patch) | |
tree | 2f94150bff5679b9f3fea26e42c1019a69a05af5 | |
parent | 299d37154b749855915c8dbc7ab8a123c4aa27f2 (diff) | |
parent | 050e84a08fa8eee14e52f4dbbee572596ba002ce (diff) | |
download | nextcloud-server-02bdb470498fb8b71f1bc582af2f55795a719c39.tar.gz nextcloud-server-02bdb470498fb8b71f1bc582af2f55795a719c39.zip |
Merge pull request #7140 from owncloud/enc_dont_login_during_encryption
refuse login as long as the initial encryption is running
-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
|