Code Duplication    Length = 19-19 lines in 2 locations

code/control/DNRoot.php 2 locations

@@ 293-311 (lines=19) @@
290
	 * @param \SS_HTTPRequest $request
291
	 * @return string - HTML
292
	 */
293
	public function createsnapshot(\SS_HTTPRequest $request) {
294
		$this->setCurrentActionType(self::ACTION_SNAPSHOT);
295
296
		// Performs canView permission check by limiting visible projects
297
		$project = $this->getCurrentProject();
298
		if (!$project) {
299
			return $this->project404Response();
300
		}
301
302
		if (!$project->canBackup()) {
303
			return new SS_HTTPResponse("Not allowed to create snapshots on any environments", 401);
304
		}
305
306
		return $this->customise([
307
			'Title' => 'Create Data Snapshot',
308
			'SnapshotsSection' => 1,
309
			'DataTransferForm' => $this->getDataTransferForm($request)
310
		])->render();
311
	}
312
313
	/**
314
	 * Action
@@ 319-337 (lines=19) @@
316
	 * @param \SS_HTTPRequest $request
317
	 * @return string - HTML
318
	 */
319
	public function uploadsnapshot(\SS_HTTPRequest $request) {
320
		$this->setCurrentActionType(self::ACTION_SNAPSHOT);
321
322
		// Performs canView permission check by limiting visible projects
323
		$project = $this->getCurrentProject();
324
		if (!$project) {
325
			return $this->project404Response();
326
		}
327
328
		if (!$project->canUploadArchive()) {
329
			return new SS_HTTPResponse("Not allowed to upload", 401);
330
		}
331
332
		return $this->customise([
333
			'SnapshotsSection' => 1,
334
			'UploadSnapshotForm' => $this->getUploadSnapshotForm($request),
335
			'PostSnapshotForm' => $this->getPostSnapshotForm($request)
336
		])->render();
337
	}
338
339
	/**
340
	 * Return the upload limit for snapshot uploads