} ); }); </script> <?php // Load required files. require_once dirname(__FILE__) . '/init.php'; require_once dirname(dirname(__FILE__)) . '/_s3lib/aws-sdk/sdk.class.php'; // Settings. if (isset(pb_backupbuddy::$options['remote_destinations'][pb_backupbuddy::_GET('destination_id')])) { $settings =& pb_backupbuddy::$options['remote_destinations'][pb_backupbuddy::_GET('destination_id')]; } $settings = array_merge(pb_backupbuddy_destination_s3::$default_settings, $settings); $remote_path = pb_backupbuddy_destination_s3::get_remote_path(); // Has leading and trailng slashes. $settings['directory'] pb_backupbuddy::$ui->title(__('Amazon S3 Destination', 'it-l10n-backupbuddy') . ' "' . $destination['title'] . '"'); $manage_data = pb_backupbuddy_destination_s3::get_manage_data($settings); // Connect to S3. $s3 = new AmazonS3($manage_data); // the key, secret, token if ($settings['ssl'] == '0') { @$s3->disable_ssl(true); } // Handle deletion. if (pb_backupbuddy::_POST('bulk_action') == 'delete_backup') { pb_backupbuddy::verify_nonce(); $deleted_files = array(); foreach ((array) pb_backupbuddy::_POST('items') as $item) { $response = $s3->delete_object($manage_data['bucket'], $manage_data['subkey'] . $remote_path . $item);
}); </script> <?php // Load required files. require_once pb_backupbuddy::plugin_path() . '/destinations/s3/init.php'; require_once dirname(dirname(__FILE__)) . '/_s3lib/aws-sdk/sdk.class.php'; // Settings. if (isset(pb_backupbuddy::$options['remote_destinations'][pb_backupbuddy::_GET('destination_id')])) { $settings =& pb_backupbuddy::$options['remote_destinations'][pb_backupbuddy::_GET('destination_id')]; } $settings = array_merge(pb_backupbuddy_destination_s3::$default_settings, $settings); $settings['bucket'] = strtolower($settings['bucket']); // Buckets must be lowercase. $remote_path = pb_backupbuddy_destination_s3::get_remote_path($settings['directory']); // Welcome text. $manage_data = pb_backupbuddy_destination_s3::get_credentials($settings); // Connect to S3. $s3 = new AmazonS3($manage_data); // the key, secret, token if ($settings['ssl'] == '0') { @$s3->disable_ssl(true); } // The bucket must be in existence and we must get it's region to be able to proceed $region = ''; pb_backupbuddy::status('details', 'Getting region for bucket: `' . $settings['bucket'] . "`."); $response = pb_backupbuddy_destination_s3::get_bucket_region($s3, $settings['bucket']); if (!$response->isOK()) { $this_error = 'Bucket region could not be determined for management operation. Message details: `' . (string) $response->body->Message . '`.'; pb_backupbuddy::status('error', $this_error);