Code Duplication    Length = 19-19 lines in 2 locations

code/control/DNRoot.php 2 locations

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