cancelBackup.php
3 years ago
cancelDownload.php
3 years ago
checkBackupCreation.php
3 years ago
checkFreeMigration.php
3 years ago
checkPHPVersionCompatibility.php
3 years ago
checkRestoreCreation.php
3 years ago
chooseProfile.php
3 years ago
cloudDropbox.php
3 years ago
curlChecker.php
3 years ago
deleteBackup.php
3 years ago
downloadBackup.php
3 years ago
getAction.php
3 years ago
getBackupContent.php
3 years ago
getRunningActions.php
3 years ago
hideNotice.php
3 years ago
importBackup.php
3 years ago
isBgUserExists.php
3 years ago
isFeatureAvailable.php
3 years ago
manualBackup.php
3 years ago
modalImport.php
3 years ago
modalManualBackup.php
3 years ago
modalManualRestore.php
3 years ago
modalPrivacy.php
3 years ago
modalReview.php
3 years ago
modalTerms.php
3 years ago
resetStatus.php
3 years ago
restore.php
3 years ago
reviewBannerActions.php
3 years ago
schedule.php
3 years ago
setReviewPopupState.php
3 years ago
settings.php
3 years ago
checkRestoreCreation.php
43 lines
| 1 | <?php |
| 2 | |
| 3 | require_once(dirname(__FILE__) . '/../boot.php'); |
| 4 | require_once(SG_BACKUP_PATH . 'SGBackup.php'); |
| 5 | |
| 6 | $runningActions = array(); |
| 7 | |
| 8 | if (backupGuardIsAjax()) { |
| 9 | $timeout = 10; //in sec |
| 10 | while ($timeout != 0) { |
| 11 | sleep(1); |
| 12 | $timeout--; |
| 13 | $created = SGConfig::get('SG_RUNNING_ACTION', true); |
| 14 | |
| 15 | if ($created) { |
| 16 | $runningActions = SGBackup::getRunningActions(); |
| 17 | // when there are multiple uncompleted actions |
| 18 | if ($runningActions && count($runningActions) == 1 && $runningActions[0]['progress'] == 0) { |
| 19 | $actionId = $runningActions[0]['id']; |
| 20 | die(json_encode(array( |
| 21 | 'status' => 0, |
| 22 | 'external_enabled' => SGExternalRestore::isEnabled() ? 1 : 0, |
| 23 | 'external_url' => SGExternalRestore::getInstance()->getDestinationFileUrl() |
| 24 | ))); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | $runningActions = SGBackup::getRunningActions(); |
| 29 | |
| 30 | if (empty($runningActions)) { |
| 31 | break; |
| 32 | } |
| 33 | } |
| 34 | if (!empty($runningActions)) { |
| 35 | SGBackup::cleanRunningActions($runningActions); |
| 36 | die(json_encode(array( |
| 37 | 'status' => 'cleaned' |
| 38 | ))); |
| 39 | } |
| 40 | |
| 41 | die('{"status":1}'); |
| 42 | } |
| 43 |