Code Duplication    Length = 19-19 lines in 2 locations

code/control/DNRoot.php 2 locations

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