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