ajax
5 years ago
config
5 years ago
cron
5 years ago
css
5 years ago
fonts
5 years ago
img
5 years ago
include
5 years ago
js
5 years ago
templates
5 years ago
backups.php
5 years ago
boot.php
5 years ago
cloud.php
5 years ago
dashboardWidget.php
5 years ago
pagesContent.php
5 years ago
proFeatures.php
5 years ago
restore_wordpress.php
5 years ago
schedule.php
5 years ago
security.php
5 years ago
services.php
5 years ago
settings.php
5 years ago
support.php
5 years ago
systemInfo.php
5 years ago
videoTutorials.php
5 years ago
cloud.php
200 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 | |
| 8 | $ftpUsername = SGConfig::get('SG_FTP_CONNECTION_STRING'); |
| 9 | $gdriveUsername = SGConfig::get('SG_GOOGLE_DRIVE_CONNECTION_STRING'); |
| 10 | $dropboxUsername = SGConfig::get('SG_DROPBOX_CONNECTION_STRING'); |
| 11 | $amazonInfo = SGConfig::get('SG_AMAZON_BUCKET'); |
| 12 | |
| 13 | $oneDriveInfo = SGConfig::get('SG_ONE_DRIVE_CONNECTION_STRING'); |
| 14 | |
| 15 | $contentClassName = getBackupPageContentClassName('cloud'); |
| 16 | |
| 17 | |
| 18 | $backupGuardCloudAccount = SGConfig::get('SG_BACKUPGUARD_CLOUD_ACCOUNT')?unserialize(SGConfig::get('SG_BACKUPGUARD_CLOUD_ACCOUNT')):''; |
| 19 | $backupGuardCloudAccountEmail = SGConfig::get('SG_BACKUPGUARD_CLOUD_ACCOUNT_EMAIL'); |
| 20 | |
| 21 | $backupGuardConnectionString = "<span>". _backupGuardT('Connect now and get 1 GB storage space for FREE', true)."</span>"; |
| 22 | |
| 23 | if (!empty($backupGuardCloudAccount)) { |
| 24 | $usedSpace = $backupGuardCloudAccount['usedStorage']; |
| 25 | $storage = $backupGuardCloudAccount['package']['storage']; |
| 26 | $availableSpaceInpercents = $usedSpace*100/$storage; |
| 27 | |
| 28 | if ($availableSpaceInpercents < 25) { |
| 29 | $usedSpaceTextColor = "green"; |
| 30 | } |
| 31 | else if ((25 <= $availableSpaceInpercents) && ($availableSpaceInpercents < 50)) { |
| 32 | $usedSpaceTextColor = "black"; |
| 33 | } |
| 34 | else if ((50 <= $availableSpaceInpercents) && ($availableSpaceInpercents <= 75)) { |
| 35 | $usedSpaceTextColor = "orange"; |
| 36 | } |
| 37 | else if ($availableSpaceInpercents >= 75) { |
| 38 | $usedSpaceTextColor = "red"; |
| 39 | } |
| 40 | |
| 41 | $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>'; |
| 42 | } |
| 43 | ?> |
| 44 | <div id="sg-backup-page-content-cloud" class="sg-backup-page-content <?php echo $contentClassName; ?>"> |
| 45 | <div class="row sg-cloud-container"> |
| 46 | <div class="col-md-12"> |
| 47 | <form class="form-horizontal"> |
| 48 | <fieldset> |
| 49 | <div><h1 class="sg-backup-page-title"><?php _backupGuardT('Cloud settings')?></h1></div> |
| 50 | <?php if (SGBoot::isFeatureAvailable('SUBDIRECTORIES')): ?> |
| 51 | <div class="form-group form-inline"> |
| 52 | <label class="col-md-5 sg-control-label"> |
| 53 | <?php _backupGuardT('Destination folder')?> |
| 54 | </label> |
| 55 | <div class="col-md-3"> |
| 56 | <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'))?>"> |
| 57 | <button type="button" id="sg-save-cloud-folder" class="btn btn-success pull-right"><?php _backupGuardT('Save');?></button> |
| 58 | </div> |
| 59 | </div> |
| 60 | <?php endif; ?> |
| 61 | <!-- BackupGuard --> |
| 62 | <?php if (SGBoot::isFeatureAvailable('BACKUP_GUARD') && SG_SHOW_BACKUPGUARD_CLOUD): ?> |
| 63 | <div class="form-group"> |
| 64 | <label class="col-md-5 sg-control-label sg-user-info"> |
| 65 | <div class="sg-cloud-icon-wrapper"> |
| 66 | <span class="sg-cloud-icon sg-cloud-backup-guard"></span> |
| 67 | </div> |
| 68 | <div class="sg-cloud-label-with-info"> |
| 69 | <span><?php echo 'BackupGuard' ?></span> |
| 70 | <span class="sg-backupguard-user sg-helper-block"> |
| 71 | <?php echo $backupGuardConnectionString ?> |
| 72 | </span> |
| 73 | </div> |
| 74 | </label> |
| 75 | <div class="col-md-3"> |
| 76 | <label class="sg-switch-container"> |
| 77 | <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"':''?>> |
| 78 | <a id="backup-guard-details" href="javascript:void(0)" class="hide" data-toggle="modal" data-modal-name="backup-guard-details" data-remote="modalBackupGuardDetails"></a> |
| 79 | </label> |
| 80 | </div> |
| 81 | </div> |
| 82 | <?php endif; ?> |
| 83 | <!-- Dropbox --> |
| 84 | <?php if (SGBoot::isFeatureAvailable('DROPBOX')): ?> |
| 85 | <div class="form-group"> |
| 86 | <label class="col-md-5 sg-control-label"> |
| 87 | <div class="sg-cloud-icon-wrapper"> |
| 88 | <span class="sg-cloud-icon sg-cloud-dropbox"></span> |
| 89 | </div> |
| 90 | <div class="sg-cloud-label-wrapper"> |
| 91 | <span><?php echo 'Dropbox' ?></span> |
| 92 | <?php if(!empty($dropboxUsername)): ?> |
| 93 | <br/> |
| 94 | <span class="text-muted sg-dropbox-user sg-helper-block"><?php echo $dropboxUsername;?></span> |
| 95 | <?php endif;?> |
| 96 | </div> |
| 97 | </label> |
| 98 | <div class="col-md-3"> |
| 99 | <label class="sg-switch-container"> |
| 100 | <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"':''?>> |
| 101 | </label> |
| 102 | </div> |
| 103 | </div> |
| 104 | <?php endif; ?> |
| 105 | <!-- Google Drive --> |
| 106 | <?php if (SGBoot::isFeatureAvailable('GOOGLE_DRIVE')): ?> |
| 107 | <div class="form-group"> |
| 108 | <label class="col-md-5 sg-control-label"> |
| 109 | <div class="sg-cloud-icon-wrapper"> |
| 110 | <span class="sg-cloud-icon sg-cloud-google-drive"></span> |
| 111 | </div> |
| 112 | <div class="sg-cloud-label-wrapper"> |
| 113 | <?php echo 'Google Drive' ?> |
| 114 | <?php if(!empty($gdriveUsername)): ?> |
| 115 | <br/> |
| 116 | <span class="text-muted sg-gdrive-user sg-helper-block"><?php echo $gdriveUsername;?></span> |
| 117 | <?php endif;?> |
| 118 | </div> |
| 119 | </label> |
| 120 | <div class="col-md-3"> |
| 121 | <label class="sg-switch-container"> |
| 122 | <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"':''?>> |
| 123 | </label> |
| 124 | </div> |
| 125 | </div> |
| 126 | <?php endif; ?> |
| 127 | <!-- FTP --> |
| 128 | <?php if (SGBoot::isFeatureAvailable('FTP')): ?> |
| 129 | <div class="form-group"> |
| 130 | <label class="col-md-5 sg-control-label sg-user-info"> |
| 131 | <div class="sg-cloud-icon-wrapper"> |
| 132 | <span class="sg-cloud-icon sg-cloud-ftp"></span> |
| 133 | </div> |
| 134 | <div class="sg-cloud-label-wrapper"> |
| 135 | <?php echo 'FTP / SFTP' ?> |
| 136 | <?php if(!empty($ftpUsername)): ?> |
| 137 | <br/> |
| 138 | <span class="text-muted sg-ftp-user sg-helper-block"><?php echo $ftpUsername;?></span> |
| 139 | <?php endif;?> |
| 140 | </div> |
| 141 | </label> |
| 142 | <div class="col-md-3"> |
| 143 | <label class="sg-switch-container"> |
| 144 | <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"':''?>> |
| 145 | <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> |
| 146 | </label> |
| 147 | </div> |
| 148 | </div> |
| 149 | <?php endif; ?> |
| 150 | <!-- Amazon S3 --> |
| 151 | <?php if (SGBoot::isFeatureAvailable('AMAZON')): ?> |
| 152 | <div class="form-group"> |
| 153 | <label class="col-md-5 sg-control-label"> |
| 154 | <div class="sg-cloud-icon-wrapper"> |
| 155 | <span class="sg-cloud-icon sg-cloud-amazon"></span> |
| 156 | </div> |
| 157 | <div class="sg-cloud-label-wrapper"> |
| 158 | <?php echo (backupGuardIsAccountGold()? 'Amazon ':'').'S3'?> |
| 159 | <?php if (!empty($amazonInfo)):?> |
| 160 | <br/> |
| 161 | <span class="text-muted sg-amazonr-user sg-helper-block"><?php echo $amazonInfo;?></span> |
| 162 | <?php endif;?> |
| 163 | </div> |
| 164 | </label> |
| 165 | <div class="col-md-3"> |
| 166 | <label class="sg-switch-container"> |
| 167 | <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"':''?>> |
| 168 | <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> |
| 169 | </label> |
| 170 | </div> |
| 171 | </div> |
| 172 | <?php endif; ?> |
| 173 | <!-- One Drive --> |
| 174 | <?php if (SGBoot::isFeatureAvailable('ONE_DRIVE')): ?> |
| 175 | <div class="form-group"> |
| 176 | <label class="col-md-5 sg-control-label"> |
| 177 | <div class="sg-cloud-icon-wrapper"> |
| 178 | <span class="sg-cloud-icon sg-cloud-one-drive"></span> |
| 179 | </div> |
| 180 | <div class="sg-cloud-label-wrapper"> |
| 181 | <?php echo 'One Drive' ?> |
| 182 | <?php if(!empty($oneDriveInfo)): ?> |
| 183 | <br/> |
| 184 | <span class="text-muted sg-gdrive-user sg-helper-block"><?php echo $oneDriveInfo;?></span> |
| 185 | <?php endif;?> |
| 186 | </div> |
| 187 | </label> |
| 188 | <div class="col-md-3"> |
| 189 | <label class="sg-switch-container"> |
| 190 | <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"':''?>> |
| 191 | </label> |
| 192 | </div> |
| 193 | </div> |
| 194 | <?php endif; ?> |
| 195 | </fieldset> |
| 196 | </form> |
| 197 | </div> |
| 198 | </div> |
| 199 | </div> |
| 200 |