Code Duplication    Length = 11-12 lines in 2 locations

apps/files_encryption/lib/util.php 2 locations

@@ 1189-1200 (lines=12) @@
1186
	 * start migration mode to initially encrypt users data
1187
	 * @return boolean
1188
	 */
1189
	public function beginMigration() {
1190
1191
		$result = $this->setMigrationStatus(self::MIGRATION_IN_PROGRESS, self::MIGRATION_OPEN);
1192
1193
		if ($result) {
1194
			\OCP\Util::writeLog('Encryption library', "Start migration to encryption mode for " . $this->userId, \OCP\Util::INFO);
1195
		} else {
1196
			\OCP\Util::writeLog('Encryption library', "Could not activate migration mode for " . $this->userId . ". Probably another process already started the initial encryption", \OCP\Util::WARN);
1197
		}
1198
1199
		return $result;
1200
	}
1201
1202
	public function resetMigrationStatus() {
1203
		return $this->setMigrationStatus(self::MIGRATION_OPEN);
@@ 1211-1221 (lines=11) @@
1208
	 * close migration mode after users data has been encrypted successfully
1209
	 * @return boolean
1210
	 */
1211
	public function finishMigration() {
1212
		$result = $this->setMigrationStatus(self::MIGRATION_COMPLETED);
1213
1214
		if ($result) {
1215
			\OCP\Util::writeLog('Encryption library', "Finish migration successfully for " . $this->userId, \OCP\Util::INFO);
1216
		} else {
1217
			\OCP\Util::writeLog('Encryption library', "Could not deactivate migration mode for " . $this->userId, \OCP\Util::WARN);
1218
		}
1219
1220
		return $result;
1221
	}
1222
1223
	/**
1224
	 * check if files are already migrated to the encryption system