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