Code Duplication    Length = 19-19 lines in 2 locations

code/control/DNRoot.php 2 locations

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