PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 2.0.3
JetBackup – Backup, Restore & Migrate v2.0.3
3.1.22.3 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.8.1 1.4.9 1.5.0 1.5.1 1.5.1.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.10 1.6.11 1.6.12 1.6.13 1.6.15 1.6.5.1 1.6.8.8 1.6.9 1.6.9.1 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7.5 2.0.8.7 2.0.9.11 2.0.9.14 2.0.9.15 2.0.9.6 2.0.9.7 2.0.9.9 3.1.10.7 3.1.11.1 3.1.12.3 3.1.13.4 3.1.14.17 3.1.15.4 3.1.16.1 3.1.17.5 3.1.18.10 3.1.18.8 3.1.18.9 3.1.19.8 3.1.20.3 3.1.21.3 3.1.7.9 3.1.9.2 trunk 1.1.90 1.1.91 1.2.0 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2
backup / public / cloud.php
backup / public Last commit date
ajax 3 years ago config 3 years ago cron 3 years ago css 3 years ago fonts 3 years ago img 3 years ago include 3 years ago js 3 years ago templates 3 years ago backups.php 3 years ago boot.php 3 years ago cloud.php 3 years ago dashboardWidget.php 3 years ago pagesContent.php 3 years ago proFeatures.php 3 years ago restore_wordpress.php 3 years ago schedule.php 3 years ago settings.php 3 years ago support.php 3 years ago systemInfo.php 3 years ago videoTutorials.php 3 years ago
cloud.php
254 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 = esc_attr(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 } else if ((25 <= $availableSpaceInpercents) && ($availableSpaceInpercents < 50)) {
34 $usedSpaceTextColor = "black";
35 } else if ((50 <= $availableSpaceInpercents) && ($availableSpaceInpercents <= 75)) {
36 $usedSpaceTextColor = "orange";
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"
57 class="form-control input-md sg-backup-input"
58 value="<?php echo esc_html(SGConfig::get('SG_STORAGE_BACKUPS_FOLDER_NAME')) ?>">
59 <button type="button" id="sg-save-cloud-folder"
60 class="btn btn-success pull-right"><?php _backupGuardT('Save'); ?></button>
61 </div>
62 </div>
63 <?php endif; ?>
64 <!-- Dropbox -->
65 <?php if (SGBoot::isFeatureAvailable('DROPBOX')) : ?>
66 <div class="form-group">
67 <label class="col-md-5 sg-control-label">
68 <div class="sg-cloud-icon-wrapper">
69 <span class="sg-cloud-icon sg-cloud-dropbox"></span>
70 </div>
71 <div class="sg-cloud-label-wrapper">
72 <span><?php echo 'Dropbox' ?></span>
73 <?php if (!empty($dropboxUsername)) : ?>
74 <br/>
75 <span class="text-muted sg-dropbox-user sg-helper-block"><?php echo esc_html($dropboxUsername); ?></span>
76 <?php endif; ?>
77 </div>
78 </label>
79 <div class="col-md-3">
80 <label class="sg-switch-container">
81 <input data-on-text="<?php _backupGuardT('ON') ?>"
82 data-off-text="<?php _backupGuardT('OFF') ?>" data-storage="DROPBOX"
83 data-remote="cloudDropbox" type="checkbox"
84 class="sg-switch" <?php echo !empty($dropbox) ? 'checked="checked"' : '' ?>>
85 </label>
86 </div>
87 </div>
88 <?php endif; ?>
89 <!-- Google Drive -->
90 <?php if (SGBoot::isFeatureAvailable('GOOGLE_DRIVE')) : ?>
91 <div class="form-group">
92 <label class="col-md-5 sg-control-label">
93 <div class="sg-cloud-icon-wrapper">
94 <span class="sg-cloud-icon sg-cloud-google-drive"></span>
95 </div>
96 <div class="sg-cloud-label-wrapper">
97 <?php echo 'Google Drive' ?>
98 <?php if (!empty($gdriveUsername)) : ?>
99 <br/>
100 <span class="text-muted sg-gdrive-user sg-helper-block"><?php echo esc_html($gdriveUsername); ?></span>
101 <?php endif; ?>
102 </div>
103 </label>
104 <div class="col-md-3">
105 <label class="sg-switch-container">
106 <input data-on-text="<?php _backupGuardT('ON') ?>"
107 data-off-text="<?php _backupGuardT('OFF') ?>" data-storage="GOOGLE_DRIVE"
108 data-remote="cloudGdrive" type="checkbox"
109 class="sg-switch" <?php echo !empty($gdrive) ? 'checked="checked"' : '' ?>>
110 </label>
111 </div>
112 </div>
113 <?php endif; ?>
114 <!-- FTP -->
115 <?php if (SGBoot::isFeatureAvailable('FTP')) : ?>
116 <div class="form-group">
117 <label class="col-md-5 sg-control-label sg-user-info">
118 <div class="sg-cloud-icon-wrapper">
119 <span class="sg-cloud-icon sg-cloud-ftp"></span>
120 </div>
121 <div class="sg-cloud-label-wrapper">
122 <?php echo 'FTP / SFTP' ?>
123 <?php if (!empty($ftpUsername)) : ?>
124 <br/>
125 <span class="text-muted sg-ftp-user sg-helper-block"><?php echo esc_html($ftpUsername); ?></span>
126 <?php endif; ?>
127 </div>
128 </label>
129 <div class="col-md-3">
130 <label class="sg-switch-container">
131 <input type="checkbox" data-on-text="<?php _backupGuardT('ON') ?>"
132 data-off-text="<?php _backupGuardT('OFF') ?>" data-storage="FTP"
133 data-remote="cloudFtp"
134 class="sg-switch" <?php echo !empty($ftp) ? 'checked="checked"' : '' ?>>
135 <a id="ftp-settings" href="javascript:void(0)" class="hide" data-toggle="modal"
136 data-modal-name="ftp-settings"
137 data-remote="modalFtpSettings"><?php echo 'FTP ' . _backupGuardT('Settings', true) ?></a>
138 </label>
139 </div>
140 </div>
141 <?php endif; ?>
142 <!-- Amazon S3 -->
143 <?php if (SGBoot::isFeatureAvailable('AMAZON')) : ?>
144 <div class="form-group">
145 <label class="col-md-5 sg-control-label">
146 <div class="sg-cloud-icon-wrapper">
147 <span class="sg-cloud-icon sg-cloud-amazon"></span>
148 </div>
149 <div class="sg-cloud-label-wrapper">
150 <?php echo (backupGuardIsAccountGold() ? 'Amazon ' : '') . 'S3' ?>
151 <?php if (!empty($amazonInfo)) : ?>
152 <br/>
153 <span class="text-muted sg-amazonr-user sg-helper-block"><?php echo esc_html($amazonInfo); ?></span>
154 <?php endif; ?>
155 </div>
156 </label>
157 <div class="col-md-3">
158 <label class="sg-switch-container">
159 <input type="checkbox" data-on-text="<?php _backupGuardT('ON') ?>"
160 data-off-text="<?php _backupGuardT('OFF') ?>" data-storage="AMAZON"
161 data-remote="cloudAmazon"
162 class="sg-switch" <?php echo !empty($amazon) ? 'checked="checked"' : '' ?>>
163 <a id="amazon-settings" href="javascript:void(0)" class="hide" data-toggle="modal"
164 data-modal-name="amazon-settings"
165 data-remote="modalAmazonSettings"><?php echo 'Amazon' . _backupGuardT('Settings', true) ?></a>
166 </label>
167 </div>
168 </div>
169 <?php endif; ?>
170 <!-- One Drive -->
171 <?php if (SGBoot::isFeatureAvailable('ONE_DRIVE')) : ?>
172 <div class="form-group">
173 <label class="col-md-5 sg-control-label">
174 <div class="sg-cloud-icon-wrapper">
175 <span class="sg-cloud-icon sg-cloud-one-drive"></span>
176 </div>
177 <div class="sg-cloud-label-wrapper">
178 <?php echo 'One Drive' ?>
179 <?php if (!empty($oneDriveInfo)) : ?>
180 <br/>
181 <span class="text-muted sg-gdrive-user sg-helper-block"><?php echo esc_html($oneDriveInfo); ?></span>
182 <?php endif; ?>
183 </div>
184 </label>
185 <div class="col-md-3">
186 <label class="sg-switch-container">
187 <input data-on-text="<?php _backupGuardT('ON') ?>"
188 data-off-text="<?php _backupGuardT('OFF') ?>" data-storage="ONE_DRIVE"
189 data-remote="cloudOneDrive" type="checkbox"
190 class="sg-switch" <?php echo !empty($oneDrive) ? 'checked="checked"' : '' ?>>
191 </label>
192 </div>
193 </div>
194 <?php endif; ?>
195
196 <!-- PCloud -->
197 <?php if (SGBoot::isFeatureAvailable('P_CLOUD')) : ?>
198 <div class="form-group">
199 <label class="col-md-5 sg-control-label">
200 <div class="sg-cloud-icon-wrapper">
201 <span class="sg-cloud-icon sg-cloud-pcloud"></span>
202 </div>
203 <div class="sg-cloud-label-wrapper">
204 <?php echo 'pCloud' ?>
205 <?php if (!empty($pCloudInfo)) : ?>
206 <br/>
207 <span class="text-muted sg-gdrive-user sg-helper-block"><?php echo json_decode($pCloudInfo, true)['email']; ?></span>
208 <?php endif; ?>
209 </div>
210 </label>
211 <div class="col-md-3">
212 <label class="sg-switch-container">
213 <input data-on-text="<?php _backupGuardT('ON') ?>"
214 data-off-text="<?php _backupGuardT('OFF') ?>" data-storage="P_CLOUD"
215 data-remote="cloudPCloud" type="checkbox"
216 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') ?>"
240 data-off-text="<?php _backupGuardT('OFF') ?>" data-storage="BOX"
241 data-remote="cloudBox" type="checkbox"
242 class="sg-switch" <?php echo !empty($box) ? 'checked="checked"' : '' ?>>
243 </label>
244 </div>
245 </div>
246 <?php endif; ?>
247
248
249 </fieldset>
250 </form>
251 </div>
252 </div>
253 </div>
254