awake.php
5 years ago
bgLogin.php
5 years ago
cancelBackup.php
5 years ago
cancelDownload.php
5 years ago
checkBackupCreation.php
5 years ago
checkPHPVersionCompatibility.php
5 years ago
checkRestoreCreation.php
5 years ago
chooseProfile.php
5 years ago
cloudDropbox.php
5 years ago
createCloudUser.php
5 years ago
curlChecker.php
5 years ago
deleteBackup.php
5 years ago
dismissDiscountNotice.php
5 years ago
downloadBackup.php
5 years ago
getAction.php
5 years ago
getBackupContent.php
5 years ago
getRunningActions.php
5 years ago
hideNotice.php
5 years ago
importBackup.php
5 years ago
isBgUserExists.php
5 years ago
isFeatureAvailable.php
5 years ago
manualBackup.php
5 years ago
modalBackupGuardDetails.php
5 years ago
modalImport.php
5 years ago
modalManualBackup.php
5 years ago
modalManualRestore.php
5 years ago
modalPrivacy.php
5 years ago
modalReview.php
5 years ago
modalTerms.php
5 years ago
resetStatus.php
5 years ago
restore.php
5 years ago
reviewBannerActions.php
5 years ago
schedule.php
5 years ago
sendUsageStatus.php
5 years ago
setReviewPopupState.php
5 years ago
setUserInfoVerificationPopupState.php
5 years ago
settings.php
5 years ago
storeSubscriberInfo.php
5 years ago
storeSurveyResult.php
5 years ago
settings.php
151 lines
| 1 | <?php |
| 2 | require_once(dirname(__FILE__).'/../boot.php'); |
| 3 | $error = array(); |
| 4 | $success = array('success'=>1); |
| 5 | |
| 6 | if (backupGuardIsAjax() && isset($_POST['cancel'])) { |
| 7 | SGConfig::set('SG_NOTIFICATIONS_ENABLED', '0'); |
| 8 | SGConfig::set('SG_NOTIFICATIONS_EMAIL_ADDRESS', ''); |
| 9 | |
| 10 | die(json_encode($success)); |
| 11 | } |
| 12 | |
| 13 | if (backupGuardIsAjax() && count($_POST)) { |
| 14 | $_POST = backupGuardRemoveSlashes($_POST); |
| 15 | $_POST = backupGuardSanitizeTextField($_POST); |
| 16 | |
| 17 | $amountOfBackupsToKeep = (int)@$_POST['amount-of-backups-to-keep']; |
| 18 | if ($amountOfBackupsToKeep <= 0) { |
| 19 | $amountOfBackupsToKeep = SG_NUMBER_OF_BACKUPS_TO_KEEP; |
| 20 | } |
| 21 | SGConfig::set('SG_AMOUNT_OF_BACKUPS_TO_KEEP', $amountOfBackupsToKeep); |
| 22 | |
| 23 | SGConfig::set('SG_NOTIFICATIONS_ENABLED', '0'); |
| 24 | $emails = ''; |
| 25 | if (isset($_POST['sgIsEmailNotification'])) { |
| 26 | $emails = @$_POST['sgUserEmail']; |
| 27 | $emailsArray = explode(',', $emails); |
| 28 | |
| 29 | if (empty($emails)) { |
| 30 | array_push($error, _backupGuardT('Email is required.', true)); |
| 31 | } |
| 32 | |
| 33 | foreach ($emailsArray as $email) { |
| 34 | $email = trim($email); |
| 35 | if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { |
| 36 | array_push($error, _backupGuardT('Invalid email address.', true)); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | SGConfig::set('SG_NOTIFICATIONS_ENABLED', '1'); |
| 41 | } |
| 42 | $ajaxInterval = (int)$_POST['ajaxInterval']; |
| 43 | |
| 44 | if (count($error)) { |
| 45 | die(json_decode($error)); |
| 46 | } |
| 47 | |
| 48 | if (isset($_POST['sg-hide-ads'])) { |
| 49 | SGConfig::set('SG_DISABLE_ADS', '1'); |
| 50 | } |
| 51 | else { |
| 52 | SGConfig::set('SG_DISABLE_ADS', '0'); |
| 53 | } |
| 54 | |
| 55 | if (isset($_POST['sg-download-via-php'])) { |
| 56 | SGConfig::set('SG_DOWNLOAD_VIA_PHP', '1'); |
| 57 | } |
| 58 | else { |
| 59 | SGConfig::set('SG_DOWNLOAD_VIA_PHP', '0'); |
| 60 | } |
| 61 | |
| 62 | if (isset($_POST['sg-background-reload-method'])) { |
| 63 | SGConfig::set('SG_BACKGROUND_RELOAD_METHOD', (int)$_POST['sg-background-reload-method']); |
| 64 | } |
| 65 | else { |
| 66 | SGConfig::set('SG_BACKGROUND_RELOAD_METHOD', SG_RELOAD_METHOD_CURL); |
| 67 | } |
| 68 | |
| 69 | if (isset($_POST['delete-backup-after-upload'])) { |
| 70 | SGConfig::set('SG_DELETE_BACKUP_AFTER_UPLOAD', '1'); |
| 71 | } |
| 72 | else { |
| 73 | SGConfig::set('SG_DELETE_BACKUP_AFTER_UPLOAD', '0'); |
| 74 | } |
| 75 | |
| 76 | if (isset($_POST['delete-backup-from-cloud'])) { |
| 77 | SGConfig::set('SG_DELETE_BACKUP_FROM_CLOUD', '1'); |
| 78 | } |
| 79 | else { |
| 80 | SGConfig::set('SG_DELETE_BACKUP_FROM_CLOUD', '0'); |
| 81 | } |
| 82 | |
| 83 | if (isset($_POST['alert-before-update'])) { |
| 84 | SGConfig::set('SG_ALERT_BEFORE_UPDATE', '1'); |
| 85 | } |
| 86 | else { |
| 87 | SGConfig::set('SG_ALERT_BEFORE_UPDATE', '0'); |
| 88 | } |
| 89 | |
| 90 | if (isset($_POST['show-statistics-widget'])) { |
| 91 | SGConfig::set('SG_SHOW_STATISTICS_WIDGET', '1'); |
| 92 | |
| 93 | } |
| 94 | else { |
| 95 | SGConfig::set('SG_SHOW_STATISTICS_WIDGET', '0'); |
| 96 | } |
| 97 | |
| 98 | if (isset($_POST['ftp-passive-mode'])) { |
| 99 | SGConfig::set('SG_FTP_PASSIVE_MODE', '1'); |
| 100 | } |
| 101 | else { |
| 102 | SGConfig::set('SG_FTP_PASSIVE_MODE', '0'); |
| 103 | } |
| 104 | |
| 105 | if (isset($_POST['sg-number-of-rows-to-backup'])) { |
| 106 | SGConfig::set('SG_BACKUP_DATABASE_INSERT_LIMIT', (int)$_POST['sg-number-of-rows-to-backup']); |
| 107 | } |
| 108 | else { |
| 109 | SGConfig::set('SG_BACKUP_DATABASE_INSERT_LIMIT', SG_BACKUP_DATABASE_INSERT_LIMIT); |
| 110 | } |
| 111 | |
| 112 | $backupFileName = 'sg_backup_'; |
| 113 | if (isset($_POST['backup-file-name'])) { |
| 114 | $backupFileName = $_POST['backup-file-name']; |
| 115 | } |
| 116 | |
| 117 | $isReloadingsEnabled = 0; |
| 118 | if (isset($_POST['backup-with-reloadings'])) { |
| 119 | $isReloadingsEnabled = 1; |
| 120 | } |
| 121 | |
| 122 | if (isset($_POST['sg-paths-to-exclude'])) { |
| 123 | SGConfig::set('SG_PATHS_TO_EXCLUDE', $_POST['sg-paths-to-exclude']); |
| 124 | } |
| 125 | else { |
| 126 | SGConfig::set('SG_PATHS_TO_EXCLUDE', ''); |
| 127 | } |
| 128 | |
| 129 | if (isset($_POST['sg-tables-to-exclude'])) { |
| 130 | SGConfig::set('SG_TABLES_TO_EXCLUDE', $_POST['sg-tables-to-exclude']); |
| 131 | } |
| 132 | else { |
| 133 | SGConfig::set('SG_TABLES_TO_EXCLUDE', ''); |
| 134 | } |
| 135 | |
| 136 | SGConfig::set('SG_BACKUP_WITH_RELOADINGS', $isReloadingsEnabled); |
| 137 | SGConfig::set('SG_BACKUP_FILE_NAME_PREFIX', $backupFileName); |
| 138 | SGConfig::set('SG_AJAX_REQUEST_FREQUENCY', $ajaxInterval); |
| 139 | SGConfig::set('SG_NOTIFICATIONS_EMAIL_ADDRESS', $emails); |
| 140 | die(json_encode($success)); |
| 141 | } |
| 142 | |
| 143 | if (backupGuardIsAjax() && $_SERVER['REQUEST_METHOD'] === 'GET') { |
| 144 | if ($_GET["type"] == "updateSetting") { |
| 145 | //disable alert-before-update from updates page |
| 146 | if (isset($_GET["alert-before-update"])) { |
| 147 | SGConfig::set('SG_ALERT_BEFORE_UPDATE', $_GET["alert-before-update"]); |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 |