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