You are here

function amazons3_admin_validate in AmazonS3 7.2

Same name and namespace in other branches
  1. 7 amazons3.module \amazons3_admin_validate()

Validate the admin form.

File

./amazons3.admin.inc, line 159

Code

function amazons3_admin_validate($form, &$form_state) {
  $bucket = $form_state['values']['amazons3_bucket'];
  $cloudfront = $form_state['values']['amazons3_cloudfront'];
  if ($cloudfront) {
    $keypair = variable_get('amazons3_cloudfront_keypair_id', FALSE);
    $pem = variable_get('amazons3_cloudfront_private_key', FALSE);
    if (empty($keypair) || empty($pem)) {
      form_set_error('amazons3_cloudfront', t('You must configure your CloudFront credentials in settings.php.'));
    }
  }
}