function encryption_settings_form_validate

7.x encryption.module encryption_settings_form_validate($form, $form_state)
6.x encryption.module encryption_settings_form_validate($form, $form_state)

File

modules/encryption/encryption.module, line 178
This is the main module file for the encryption module.

Code

function encryption_settings_form_validate($form, $form_state) {
  // Did the user enter "YES" to the confirmation question?
  if (trim($form_state ["values"]["encryption_confirm"]) != "YES") {
    form_error("encryption_confirm", t("To submit this form, you must enter YES (all caps) in the confirmation box."));
    return;
  }


  // If they entered a path to the file, make sure it exists and we can read it.
  if ($encryption_key_path != "") {
    $contents = file_get_contents($encryption_key_path);
    if (!$contents) {
      form_error("encryption_key_path", t("You entered a path to a key file, but either that file doesn't exist, is empty, or is unreadable by the
                                           web user on your system.  Please correct the issue and try again."));
      return;
    }
  }
}