|
@@ 338-356 (lines=19) @@
|
| 335 |
|
* @param SS_HTTPRequest $request |
| 336 |
|
* @return string - HTML |
| 337 |
|
*/ |
| 338 |
|
public function createsnapshot(SS_HTTPRequest $request) |
| 339 |
|
{ |
| 340 |
|
$this->setCurrentActionType(self::ACTION_SNAPSHOT); |
| 341 |
|
|
| 342 |
|
// Performs canView permission check by limiting visible projects |
| 343 |
|
$project = $this->getCurrentProject(); |
| 344 |
|
if (!$project) { |
| 345 |
|
return $this->project404Response(); |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
if (!$project->canBackup()) { |
| 349 |
|
return new SS_HTTPResponse("Not allowed to create snapshots on any environments", 401); |
| 350 |
|
} |
| 351 |
|
|
| 352 |
|
return $this->customise(array( |
| 353 |
|
'Title' => 'Create Data Snapshot', |
| 354 |
|
'SnapshotsSection' => 1, |
| 355 |
|
'DataTransferForm' => $this->getDataTransferForm($request) |
| 356 |
|
))->render(); |
| 357 |
|
} |
| 358 |
|
|
| 359 |
|
/** |
|
@@ 365-383 (lines=19) @@
|
| 362 |
|
* @param SS_HTTPRequest $request |
| 363 |
|
* @return string - HTML |
| 364 |
|
*/ |
| 365 |
|
public function uploadsnapshot(SS_HTTPRequest $request) |
| 366 |
|
{ |
| 367 |
|
$this->setCurrentActionType(self::ACTION_SNAPSHOT); |
| 368 |
|
|
| 369 |
|
// Performs canView permission check by limiting visible projects |
| 370 |
|
$project = $this->getCurrentProject(); |
| 371 |
|
if (!$project) { |
| 372 |
|
return $this->project404Response(); |
| 373 |
|
} |
| 374 |
|
|
| 375 |
|
if (!$project->canUploadArchive()) { |
| 376 |
|
return new SS_HTTPResponse("Not allowed to upload", 401); |
| 377 |
|
} |
| 378 |
|
|
| 379 |
|
return $this->customise(array( |
| 380 |
|
'SnapshotsSection' => 1, |
| 381 |
|
'UploadSnapshotForm' => $this->getUploadSnapshotForm($request), |
| 382 |
|
'PostSnapshotForm' => $this->getPostSnapshotForm($request) |
| 383 |
|
))->render(); |
| 384 |
|
} |
| 385 |
|
|
| 386 |
|
/** |