summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-02-06 21:26:32 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-02-06 21:26:32 +0100
commitb4b45a1a521b68ac7931621af652055e1ce131e8 (patch)
treee8adc57730f87be7b1c86f01b3501b6ddd1afeca /apps/files_encryption
parent988027fdcaed92a01770eb458452071f756e0d1a (diff)
parent15b2d33599e28477a712a9dc788f2b64523a71a9 (diff)
downloadnextcloud-server-b4b45a1a521b68ac7931621af652055e1ce131e8.tar.gz
nextcloud-server-b4b45a1a521b68ac7931621af652055e1ce131e8.zip
Merge pull request #13954 from owncloud/fix-enc-mig-user-retrieval
Fix enc mig user retrieval
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/command/migratekeys.php12
-rw-r--r--apps/files_encryption/lib/migration.php13
2 files changed, 18 insertions, 7 deletions
diff --git a/apps/files_encryption/command/migratekeys.php b/apps/files_encryption/command/migratekeys.php
index 200d7367da6..d6db1f70892 100644
--- a/apps/files_encryption/command/migratekeys.php
+++ b/apps/files_encryption/command/migratekeys.php
@@ -62,11 +62,17 @@ class MigrateKeys extends Command {
}
$output->writeln("Migrating keys for users on backend <info>$name</info>");
- $users = $backend->getUsers();
- foreach ($users as $user) {
+
+ $limit = 500;
+ $offset = 0;
+ do {
+ $users = $backend->getUsers('', $limit, $offset);
+ foreach ($users as $user) {
$output->writeln(" <info>$user</info>");
$migration->reorganizeFolderStructureForUser($user);
- }
+ }
+ $offset += $limit;
+ } while(count($users) >= $limit);
}
}
diff --git a/apps/files_encryption/lib/migration.php b/apps/files_encryption/lib/migration.php
index 8af633aeaff..7a036ade3fc 100644
--- a/apps/files_encryption/lib/migration.php
+++ b/apps/files_encryption/lib/migration.php
@@ -42,10 +42,15 @@ class Migration {
public function reorganizeFolderStructure() {
$this->reorganizeSystemFolderStructure();
- $users = \OCP\User::getUsers();
- foreach ($users as $user) {
- $this->reorganizeFolderStructureForUser($user);
- }
+ $limit = 500;
+ $offset = 0;
+ do {
+ $users = \OCP\User::getUsers('', $limit, $offset);
+ foreach ($users as $user) {
+ $this->reorganizeFolderStructureForUser($user);
+ }
+ $offset += $limit;
+ } while(count($users) >= $limit);
}
public function reorganizeSystemFolderStructure() {