Code Duplication    Length = 19-19 lines in 2 locations

code/control/DNRoot.php 2 locations

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