Code Duplication    Length = 19-19 lines in 2 locations

code/control/DNRoot.php 2 locations

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