You are here

function video_s3_bucket_delete in Video 6.4

1 string reference to 'video_s3_bucket_delete'
video_s3_menu in plugins/video_s3/video_s3.module

File

plugins/video_s3/video_s3.module, line 139
Provides wrapper functions for the s3 amazon webservices.

Code

function video_s3_bucket_delete($bucket) {
  module_load_include('lib.inc', 'video_s3');
  $s3 = new video_amazon_s3();
  $s3
    ->connect();
  $buckets = $s3->s3
    ->listBuckets();
  if (is_array($buckets) && in_array($bucket, $buckets)) {
    if ($s3->s3
      ->deleteBucket($bucket)) {
      drupal_set_message(t('Successfully deleted the bucket %bucket', array(
        '%bucket' => $bucket,
      )));
    }
    else {
      drupal_set_message(t('Could not delete the bucket %bucket', array(
        '%bucket' => $bucket,
      )), 'error');
    }
  }
  else {
    drupal_set_message(t('The bucket %bucket does not exist for deletion.', array(
      '%bucket' => $bucket,
    )), 'error');
  }
  drupal_goto('admin/settings/video/amazon_s3');
}