Dropbox2
6 years ago
Google
6 years ago
checkout-embed
6 years ago
cloudfiles
12 years ago
handlebars
6 years ago
images
9 years ago
jquery.serializeJSON
7 years ago
jstree
6 years ago
labelauty
6 years ago
tether
6 years ago
tether-shepherd
7 years ago
updraftclone
6 years ago
S3.php
6 years ago
S3compat.php
6 years ago
cacert.pem
6 years ago
class-backup-history.php
6 years ago
class-commands.php
6 years ago
class-database-utility.php
6 years ago
class-filesystem-functions.php
6 years ago
class-job-scheduler.php
6 years ago
class-manipulation-functions.php
7 years ago
class-partialfileservlet.php
9 years ago
class-remote-send.php
6 years ago
class-semaphore.php
6 years ago
class-storage-methods-interface.php
6 years ago
class-udrpc.php
6 years ago
class-updraft-dashboard-news.php
6 years ago
class-updraftcentral-updraftplus-commands.php
8 years ago
class-updraftplus-encryption.php
6 years ago
class-wpadmin-commands.php
6 years ago
class-zip.php
6 years ago
ftp.class.php
7 years ago
get-cpanel-quota-usage.pl
12 years ago
google-extensions.php
9 years ago
jquery-ui.custom.css
7 years ago
jquery-ui.custom.min.css
7 years ago
jquery-ui.custom.min.css.map
7 years ago
jquery.blockUI.js
8 years ago
jquery.blockUI.min.js
8 years ago
updraft-admin-common.js
6 years ago
updraft-admin-common.min.js
6 years ago
updraft-notices.php
6 years ago
updraft-restorer-skin-compatibility.php
6 years ago
updraft-restorer-skin.php
6 years ago
updraftcentral.php
7 years ago
updraftplus-clone.php
6 years ago
updraftplus-login.php
7 years ago
updraftplus-notices.php
6 years ago
updraftplus-tour.php
7 years ago
updraftvault.php
6 years ago
updraftvault.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | if (!defined('UPDRAFTPLUS_DIR')) die('No access.'); |
| 4 | |
| 5 | /** |
| 6 | * Handles UpdraftVault Commands to pull Amazon S3 Bucket credentials |
| 7 | * from user's UpdraftVault and some default filters for per page display |
| 8 | * |
| 9 | * @method array get_credentials() |
| 10 | */ |
| 11 | class UpdraftCentral_UpdraftVault_Commands extends UpdraftCentral_Commands { |
| 12 | |
| 13 | /** |
| 14 | * Gets the Amazon S3 Credentials |
| 15 | * |
| 16 | * Extract the needed credentials to connect to the user's Amazon S3 Bucket |
| 17 | * by pulling this info from the UpdraftVault server. |
| 18 | * |
| 19 | * @return array $result - An array containing the Amazon S3 settings/config if successful, |
| 20 | * otherwise, it will contain the error details/info of the generated error. |
| 21 | */ |
| 22 | public function get_credentials() { |
| 23 | $storage_objects_and_ids = UpdraftPlus_Storage_Methods_Interface::get_storage_objects_and_ids(array('updraftvault')); |
| 24 | |
| 25 | // UpdraftVault isn't expected to have multiple options currently, so we just grab the first instance_id in the settings and use the options from that. If in future we do decide we want to make UpdraftVault multiple options then we will need to update this part of the code e.g a instance_id needs to be passed in and used by the following lines of code. |
| 26 | if (isset($storage_objects_and_ids['updraftvault']['instance_settings'])) { |
| 27 | $instance_id = key($storage_objects_and_ids['updraftvault']['instance_settings']); |
| 28 | $opts = $storage_objects_and_ids['updraftvault']['instance_settings'][$instance_id]; |
| 29 | $vault = $storage_objects_and_ids['updraftvault']['object']; |
| 30 | $vault->set_options($opts, false, $instance_id); |
| 31 | } else { |
| 32 | if (!class_exists('UpdraftPlus_BackupModule_updraftvault')) include_once(UPDRAFTPLUS_DIR.'/methods/updraftvault.php'); |
| 33 | $vault = new UpdraftPlus_BackupModule_updraftvault(); |
| 34 | } |
| 35 | |
| 36 | $result = $vault->get_config(); |
| 37 | |
| 38 | if (isset($result['error']) && !empty($result['error'])) { |
| 39 | $result = array('error' => true, 'message' => $result['error']['message'], 'values' => $result['error']['values']); |
| 40 | } |
| 41 | |
| 42 | return $this->_response($result); |
| 43 | } |
| 44 | } |
| 45 |