Code Duplication    Length = 13-14 lines in 2 locations

core/Command/Encryption/ChangeKeyStorageRoot.php 1 location

@@ 196-208 (lines=13) @@
193
		$progress->start();
194
195
196
		foreach($this->userManager->getBackends() as $backend) {
197
			$limit = 500;
198
			$offset = 0;
199
			do {
200
				$users = $backend->getUsers('', $limit, $offset);
201
				foreach ($users as $user) {
202
					$progress->advance();
203
					$this->setupUserFS($user);
204
					$this->moveUserEncryptionFolder($user, $oldRoot, $newRoot);
205
				}
206
				$offset += $limit;
207
			} while(count($users) >= $limit);
208
		}
209
		$progress->finish();
210
	}
211

lib/private/Encryption/DecryptAll.php 1 location

@@ 156-169 (lines=14) @@
153
			$fetchUsersProgress->setMessage("Fetch list of users...");
154
			$fetchUsersProgress->advance();
155
156
			foreach ($this->userManager->getBackends() as $backend) {
157
				$limit = 500;
158
				$offset = 0;
159
				do {
160
					$users = $backend->getUsers('', $limit, $offset);
161
					foreach ($users as $user) {
162
						$userList[] = $user;
163
					}
164
					$offset += $limit;
165
					$fetchUsersProgress->advance();
166
				} while (count($users) >= $limit);
167
				$fetchUsersProgress->setMessage("Fetch list of users... finished");
168
				$fetchUsersProgress->finish();
169
			}
170
		} else {
171
			$userList[] = $user;
172
		}