You are here

function _protected_node_node_type_submit in Protected Node 7

Same name and namespace in other branches
  1. 6 protected_node.settings.inc \_protected_node_node_type_submit()
  2. 1.0.x protected_node.settings.inc \_protected_node_node_type_submit()

Do a little extra work on submission.

1 string reference to '_protected_node_node_type_submit'
protected_node_node_type_form_alter in ./protected_node.settings.inc
Implements hook_form_FORM_ID_alter().

File

./protected_node.settings.inc, line 1055
Configuration file for the protected_node module.

Code

function _protected_node_node_type_submit($form, &$form_state) {

  // Make doubly sure the unencrypted field doesn't get saved
  // (it should already be removed in the validate() function).
  unset($form_state['values']['protected_node_node_type_password_field']);

  // Delete the current password_field variable if it exists.
  $node_type = trim($form_state['values']['type']);
  variable_del('protected_node_node_type_password_field_' . $node_type);
  if (!empty($form_state['values']['old_type'])) {

    // Delete the old password field variable if it exists.
    $old_node_type = $form_state['values']['old_type'];
    variable_del('protected_node_node_type_password_field_' . $old_node_type);
  }
}