Code Duplication    Length = 19-19 lines in 2 locations

code/control/DNRoot.php 2 locations

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