Code Duplication    Length = 19-19 lines in 2 locations

code/control/DNRoot.php 2 locations

@@ 316-334 (lines=19) @@
313
	 * @param SS_HTTPRequest $request
314
	 * @return string - HTML
315
	 */
316
	public function createsnapshot(SS_HTTPRequest $request) {
317
		$this->setCurrentActionType(self::ACTION_SNAPSHOT);
318
319
		// Performs canView permission check by limiting visible projects
320
		$project = $this->getCurrentProject();
321
		if (!$project) {
322
			return $this->project404Response();
323
		}
324
325
		if (!$project->canBackup()) {
326
			return new SS_HTTPResponse("Not allowed to create snapshots on any environments", 401);
327
		}
328
329
		return $this->customise([
330
			'Title' => 'Create Data Snapshot',
331
			'SnapshotsSection' => 1,
332
			'DataTransferForm' => $this->getDataTransferForm($request)
333
		])->render();
334
	}
335
336
	/**
337
	 * Action
@@ 342-360 (lines=19) @@
339
	 * @param SS_HTTPRequest $request
340
	 * @return string - HTML
341
	 */
342
	public function uploadsnapshot(SS_HTTPRequest $request) {
343
		$this->setCurrentActionType(self::ACTION_SNAPSHOT);
344
345
		// Performs canView permission check by limiting visible projects
346
		$project = $this->getCurrentProject();
347
		if (!$project) {
348
			return $this->project404Response();
349
		}
350
351
		if (!$project->canUploadArchive()) {
352
			return new SS_HTTPResponse("Not allowed to upload", 401);
353
		}
354
355
		return $this->customise([
356
			'SnapshotsSection' => 1,
357
			'UploadSnapshotForm' => $this->getUploadSnapshotForm($request),
358
			'PostSnapshotForm' => $this->getPostSnapshotForm($request)
359
		])->render();
360
	}
361
362
	/**
363
	 * Return the upload limit for snapshot uploads