ajax
3 years ago
config
4 years ago
cron
6 years ago
css
3 years ago
fonts
5 years ago
img
3 years ago
include
3 years ago
js
3 years ago
templates
3 years ago
backups.php
4 years ago
boot.php
4 years ago
cloud.php
5 years ago
dashboardWidget.php
5 years ago
pagesContent.php
4 years ago
proFeatures.php
4 years ago
restore_wordpress.php
4 years ago
schedule.php
4 years ago
security.php
4 years ago
services.php
5 years ago
settings.php
4 years ago
support.php
4 years ago
systemInfo.php
4 years ago
videoTutorials.php
4 years ago
cloud.php
251 lines
| 1 | <?php |
| 2 | $dropbox = SGConfig::get('SG_DROPBOX_ACCESS_TOKEN'); |
| 3 | $gdrive = SGConfig::get('SG_GOOGLE_DRIVE_REFRESH_TOKEN'); |
| 4 | $ftp = SGConfig::get('SG_STORAGE_FTP_CONNECTED'); |
| 5 | $amazon = SGConfig::get('SG_STORAGE_AMAZON_CONNECTED'); |
| 6 | $oneDrive = SGConfig::get('SG_ONE_DRIVE_REFRESH_TOKEN'); |
| 7 | $pCloud = SGConfig::get('SG_P_CLOUD_ACCESS_TOKEN'); |
| 8 | $box = SGConfig::get('SG_BOX_REFRESH_TOKEN'); |
| 9 | $ftpUsername = SGConfig::get('SG_FTP_CONNECTION_STRING'); |
| 10 | $gdriveUsername = SGConfig::get('SG_GOOGLE_DRIVE_CONNECTION_STRING'); |
| 11 | $dropboxUsername = SGConfig::get('SG_DROPBOX_CONNECTION_STRING'); |
| 12 | $amazonInfo = SGConfig::get('SG_AMAZON_BUCKET'); |
| 13 | |
| 14 | $oneDriveInfo = SGConfig::get('SG_ONE_DRIVE_CONNECTION_STRING'); |
| 15 | $pCloudInfo = SGConfig::get('SG_P_CLOUD_CONNECTION_STRING'); |
| 16 | $boxInfo = SGConfig::get('SG_BOX_CONNECTION_STRING'); |
| 17 | |
| 18 | $contentClassName = getBackupPageContentClassName('cloud'); |
| 19 | |
| 20 | |
| 21 | $backupGuardCloudAccount = SGConfig::get('SG_BACKUPGUARD_CLOUD_ACCOUNT')?unserialize(SGConfig::get('SG_BACKUPGUARD_CLOUD_ACCOUNT')):''; |
| 22 | $backupGuardCloudAccountEmail = SGConfig::get('SG_BACKUPGUARD_CLOUD_ACCOUNT_EMAIL'); |
| 23 | |
| 24 | $backupGuardConnectionString = "<span>". _backupGuardT('Connect now and get 1 GB storage space for FREE', true)."</span>"; |
| 25 | |
| 26 | if (!empty($backupGuardCloudAccount)) { |
| 27 | $usedSpace = $backupGuardCloudAccount['usedStorage']; |
| 28 | $storage = $backupGuardCloudAccount['package']['storage']; |
| 29 | $availableSpaceInpercents = $usedSpace*100/$storage; |
| 30 | |
| 31 | if ($availableSpaceInpercents < 25) { |
| 32 | $usedSpaceTextColor = "green"; |
| 33 | } |
| 34 | else if ((25 <= $availableSpaceInpercents) && ($availableSpaceInpercents < 50)) { |
| 35 | $usedSpaceTextColor = "black"; |
| 36 | } |
| 37 | else if ((50 <= $availableSpaceInpercents) && ($availableSpaceInpercents <= 75)) { |
| 38 | $usedSpaceTextColor = "orange"; |
| 39 | } |
| 40 | else if ($availableSpaceInpercents >= 75) { |
| 41 | $usedSpaceTextColor = "red"; |
| 42 | } |
| 43 | |
| 44 | $backupGuardConnectionString = $backupGuardCloudAccountEmail.' | <span style="color: '.$usedSpaceTextColor.';">'.convertToReadableSize($usedSpace*BACKUP_GUARD_ONE_MB).' / '.convertToReadableSize($storage*BACKUP_GUARD_ONE_MB).'</span> | <a target="_blank" href="'.BACKUP_GUARD_CLOUD_UPGRADE_URL.'">Upgrade for more space</a>'; |
| 45 | } |
| 46 | ?> |
| 47 | <div id="sg-backup-page-content-cloud" class="sg-backup-page-content <?php echo $contentClassName; ?>"> |
| 48 | <div class="row sg-cloud-container"> |
| 49 | <div class="col-md-12"> |
| 50 | <form class="form-horizontal"> |
| 51 | <fieldset> |
| 52 | <div><h1 class="sg-backup-page-title"><?php _backupGuardT('Cloud settings')?></h1></div> |
| 53 | <?php if (SGBoot::isFeatureAvailable('SUBDIRECTORIES')): ?> |
| 54 | <div class="form-group form-inline"> |
| 55 | <label class="col-md-5 sg-control-label"> |
| 56 | <?php _backupGuardT('Destination folder')?> |
| 57 | </label> |
| 58 | <div class="col-md-3"> |
| 59 | <input id="cloudFolder" name="cloudFolder" type="text" class="form-control input-md sg-backup-input" value="<?php echo esc_html(SGConfig::get('SG_STORAGE_BACKUPS_FOLDER_NAME'))?>"> |
| 60 | <button type="button" id="sg-save-cloud-folder" class="btn btn-success pull-right"><?php _backupGuardT('Save');?></button> |
| 61 | </div> |
| 62 | </div> |
| 63 | <?php endif; ?> |
| 64 | <!-- BackupGuard --> |
| 65 | <?php if (SGBoot::isFeatureAvailable('BACKUP_GUARD') && SG_SHOW_BACKUPGUARD_CLOUD): ?> |
| 66 | <div class="form-group"> |
| 67 | <label class="col-md-5 sg-control-label sg-user-info"> |
| 68 | <div class="sg-cloud-icon-wrapper"> |
| 69 | <span class="sg-cloud-icon sg-cloud-backup-guard"></span> |
| 70 | </div> |
| 71 | <div class="sg-cloud-label-with-info"> |
| 72 | <span><?php echo 'BackupGuard' ?></span> |
| 73 | <span class="sg-backupguard-user sg-helper-block"> |
| 74 | <?php echo $backupGuardConnectionString ?> |
| 75 | </span> |
| 76 | </div> |
| 77 | </label> |
| 78 | <div class="col-md-3"> |
| 79 | <label class="sg-switch-container"> |
| 80 | <input type="checkbox" data-on-text="<?php _backupGuardT('ON')?>" data-off-text="<?php _backupGuardT('OFF')?>" data-storage="BACKUP_GUARD" data-remote="bgLogin" class="sg-switch" <?php echo !empty($backupGuardCloudAccount)?'checked="checked"':''?>> |
| 81 | <a id="backup-guard-details" href="javascript:void(0)" class="hide" data-toggle="modal" data-modal-name="backup-guard-details" data-remote="modalBackupGuardDetails"></a> |
| 82 | </label> |
| 83 | </div> |
| 84 | </div> |
| 85 | <?php endif; ?> |
| 86 | <!-- Dropbox --> |
| 87 | <?php if (SGBoot::isFeatureAvailable('DROPBOX')): ?> |
| 88 | <div class="form-group"> |
| 89 | <label class="col-md-5 sg-control-label"> |
| 90 | <div class="sg-cloud-icon-wrapper"> |
| 91 | <span class="sg-cloud-icon sg-cloud-dropbox"></span> |
| 92 | </div> |
| 93 | <div class="sg-cloud-label-wrapper"> |
| 94 | <span><?php echo 'Dropbox' ?></span> |
| 95 | <?php if(!empty($dropboxUsername)): ?> |
| 96 | <br/> |
| 97 | <span class="text-muted sg-dropbox-user sg-helper-block"><?php echo $dropboxUsername;?></span> |
| 98 | <?php endif;?> |
| 99 | </div> |
| 100 | </label> |
| 101 | <div class="col-md-3"> |
| 102 | <label class="sg-switch-container"> |
| 103 | <input data-on-text="<?php _backupGuardT('ON')?>" data-off-text="<?php _backupGuardT('OFF')?>" data-storage="DROPBOX" data-remote="cloudDropbox" type="checkbox" class="sg-switch" <?php echo !empty($dropbox)?'checked="checked"':''?>> |
| 104 | </label> |
| 105 | </div> |
| 106 | </div> |
| 107 | <?php endif; ?> |
| 108 | <!-- Google Drive --> |
| 109 | <?php if (SGBoot::isFeatureAvailable('GOOGLE_DRIVE')): ?> |
| 110 | <div class="form-group"> |
| 111 | <label class="col-md-5 sg-control-label"> |
| 112 | <div class="sg-cloud-icon-wrapper"> |
| 113 | <span class="sg-cloud-icon sg-cloud-google-drive"></span> |
| 114 | </div> |
| 115 | <div class="sg-cloud-label-wrapper"> |
| 116 | <?php echo 'Google Drive' ?> |
| 117 | <?php if(!empty($gdriveUsername)): ?> |
| 118 | <br/> |
| 119 | <span class="text-muted sg-gdrive-user sg-helper-block"><?php echo $gdriveUsername;?></span> |
| 120 | <?php endif;?> |
| 121 | </div> |
| 122 | </label> |
| 123 | <div class="col-md-3"> |
| 124 | <label class="sg-switch-container"> |
| 125 | <input data-on-text="<?php _backupGuardT('ON')?>" data-off-text="<?php _backupGuardT('OFF')?>" data-storage="GOOGLE_DRIVE" data-remote="cloudGdrive" type="checkbox" class="sg-switch" <?php echo !empty($gdrive)?'checked="checked"':''?>> |
| 126 | </label> |
| 127 | </div> |
| 128 | </div> |
| 129 | <?php endif; ?> |
| 130 | <!-- FTP --> |
| 131 | <?php if (SGBoot::isFeatureAvailable('FTP')): ?> |
| 132 | <div class="form-group"> |
| 133 | <label class="col-md-5 sg-control-label sg-user-info"> |
| 134 | <div class="sg-cloud-icon-wrapper"> |
| 135 | <span class="sg-cloud-icon sg-cloud-ftp"></span> |
| 136 | </div> |
| 137 | <div class="sg-cloud-label-wrapper"> |
| 138 | <?php echo 'FTP / SFTP' ?> |
| 139 | <?php if(!empty($ftpUsername)): ?> |
| 140 | <br/> |
| 141 | <span class="text-muted sg-ftp-user sg-helper-block"><?php echo $ftpUsername;?></span> |
| 142 | <?php endif;?> |
| 143 | </div> |
| 144 | </label> |
| 145 | <div class="col-md-3"> |
| 146 | <label class="sg-switch-container"> |
| 147 | <input type="checkbox" data-on-text="<?php _backupGuardT('ON')?>" data-off-text="<?php _backupGuardT('OFF')?>" data-storage="FTP" data-remote="cloudFtp" class="sg-switch" <?php echo !empty($ftp)?'checked="checked"':''?>> |
| 148 | <a id="ftp-settings" href="javascript:void(0)" class="hide" data-toggle="modal" data-modal-name="ftp-settings" data-remote="modalFtpSettings"><?php echo 'FTP '._backupGuardT('Settings', true) ?></a> |
| 149 | </label> |
| 150 | </div> |
| 151 | </div> |
| 152 | <?php endif; ?> |
| 153 | <!-- Amazon S3 --> |
| 154 | <?php if (SGBoot::isFeatureAvailable('AMAZON')): ?> |
| 155 | <div class="form-group"> |
| 156 | <label class="col-md-5 sg-control-label"> |
| 157 | <div class="sg-cloud-icon-wrapper"> |
| 158 | <span class="sg-cloud-icon sg-cloud-amazon"></span> |
| 159 | </div> |
| 160 | <div class="sg-cloud-label-wrapper"> |
| 161 | <?php echo (backupGuardIsAccountGold()? 'Amazon ':'').'S3'?> |
| 162 | <?php if (!empty($amazonInfo)):?> |
| 163 | <br/> |
| 164 | <span class="text-muted sg-amazonr-user sg-helper-block"><?php echo $amazonInfo;?></span> |
| 165 | <?php endif;?> |
| 166 | </div> |
| 167 | </label> |
| 168 | <div class="col-md-3"> |
| 169 | <label class="sg-switch-container"> |
| 170 | <input type="checkbox" data-on-text="<?php _backupGuardT('ON')?>" data-off-text="<?php _backupGuardT('OFF')?>" data-storage="AMAZON" data-remote="cloudAmazon" class="sg-switch" <?php echo !empty($amazon)?'checked="checked"':''?>> |
| 171 | <a id="amazon-settings" href="javascript:void(0)" class="hide" data-toggle="modal" data-modal-name="amazon-settings" data-remote="modalAmazonSettings"><?php echo 'Amazon'._backupGuardT('Settings', true)?></a> |
| 172 | </label> |
| 173 | </div> |
| 174 | </div> |
| 175 | <?php endif; ?> |
| 176 | <!-- One Drive --> |
| 177 | <?php if (SGBoot::isFeatureAvailable('ONE_DRIVE')): ?> |
| 178 | <div class="form-group"> |
| 179 | <label class="col-md-5 sg-control-label"> |
| 180 | <div class="sg-cloud-icon-wrapper"> |
| 181 | <span class="sg-cloud-icon sg-cloud-one-drive"></span> |
| 182 | </div> |
| 183 | <div class="sg-cloud-label-wrapper"> |
| 184 | <?php echo 'One Drive' ?> |
| 185 | <?php if(!empty($oneDriveInfo)): ?> |
| 186 | <br/> |
| 187 | <span class="text-muted sg-gdrive-user sg-helper-block"><?php echo $oneDriveInfo;?></span> |
| 188 | <?php endif;?> |
| 189 | </div> |
| 190 | </label> |
| 191 | <div class="col-md-3"> |
| 192 | <label class="sg-switch-container"> |
| 193 | <input data-on-text="<?php _backupGuardT('ON')?>" data-off-text="<?php _backupGuardT('OFF')?>" data-storage="ONE_DRIVE" data-remote="cloudOneDrive" type="checkbox" class="sg-switch" <?php echo !empty($oneDrive)?'checked="checked"':''?>> |
| 194 | </label> |
| 195 | </div> |
| 196 | </div> |
| 197 | <?php endif; ?> |
| 198 | |
| 199 | <!-- PCloud --> |
| 200 | <?php if ( SGBoot::isFeatureAvailable( 'P_CLOUD' ) ): ?> |
| 201 | <div class="form-group"> |
| 202 | <label class="col-md-5 sg-control-label"> |
| 203 | <div class="sg-cloud-icon-wrapper"> |
| 204 | <span class="sg-cloud-icon sg-cloud-pcloud"></span> |
| 205 | </div> |
| 206 | <div class="sg-cloud-label-wrapper"> |
| 207 | <?php echo 'pCloud' ?> |
| 208 | <?php if ( ! empty( $pCloudInfo ) ): ?> |
| 209 | <br/> |
| 210 | <span class="text-muted sg-gdrive-user sg-helper-block"><?php echo json_decode( $pCloudInfo, true )['email']; ?></span> |
| 211 | <?php endif; ?> |
| 212 | </div> |
| 213 | </label> |
| 214 | <div class="col-md-3"> |
| 215 | <label class="sg-switch-container"> |
| 216 | <input data-on-text="<?php _backupGuardT('ON')?>" data-off-text="<?php _backupGuardT('OFF')?>" data-storage="P_CLOUD" data-remote="cloudPCloud" type="checkbox" class="sg-switch" <?php echo !empty($pCloud)?'checked="checked"':''?>> |
| 217 | </label> |
| 218 | </div> |
| 219 | </div> |
| 220 | <?php endif; ?> |
| 221 | |
| 222 | <!-- Box --> |
| 223 | <?php if ( SGBoot::isFeatureAvailable( 'BOX' ) ): ?> |
| 224 | <div class="form-group"> |
| 225 | <label class="col-md-5 sg-control-label"> |
| 226 | <div class="sg-cloud-icon-wrapper"> |
| 227 | <span class="sg-cloud-icon sg-cloud-box"></span> |
| 228 | </div> |
| 229 | <div class="sg-cloud-label-wrapper"> |
| 230 | <?php echo 'box.com' ?> |
| 231 | <?php if ( ! empty( $boxInfo ) ): ?> |
| 232 | <br/> |
| 233 | <span class="text-muted sg-gdrive-user sg-helper-block"><?php echo json_decode( $boxInfo, true )['login']; ?></span> |
| 234 | <?php endif; ?> |
| 235 | </div> |
| 236 | </label> |
| 237 | <div class="col-md-3"> |
| 238 | <label class="sg-switch-container"> |
| 239 | <input data-on-text="<?php _backupGuardT('ON')?>" data-off-text="<?php _backupGuardT('OFF')?>" data-storage="BOX" data-remote="cloudBox" type="checkbox" class="sg-switch" <?php echo !empty($box)?'checked="checked"':''?>> |
| 240 | </label> |
| 241 | </div> |
| 242 | </div> |
| 243 | <?php endif; ?> |
| 244 | |
| 245 | |
| 246 | </fieldset> |
| 247 | </form> |
| 248 | </div> |
| 249 | </div> |
| 250 | </div> |
| 251 |