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