Code Duplication    Length = 19-19 lines in 2 locations

code/control/DNRoot.php 2 locations

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