You are here

function lockr_admin_advanced_form_validate in Lockr 7.3

File

./lockr.admin.inc, line 244
Form callbacks for Lockr register form.

Code

function lockr_admin_advanced_form_validate($form, &$form_state) {
  $values = $form_state['values'];
  if (!$values['custom']) {
    return;
  }
  $cert_path = $values['custom_cert'];
  if (!$cert_path) {
    form_set_error('custom_cert', t('Certificate location is required for custom certs'));
    return;
  }
  $real_cert_path = drupal_realpath($cert_path);
  if (is_dir($cert_path) || !is_readable($cert_path)) {
    form_set_error('custom_cert', t('Certificate must be a readable file'));
  }
}