You are here

function _protected_node_admin_settings_submit in Protected Node 7

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

Submit handler.

Submitting the form requires a little bit of work for the password. We need to encrypt it.

1 string reference to '_protected_node_admin_settings_submit'
protected_node_admin_settings in ./protected_node.settings.inc
Define the settings form.

File

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

Code

function _protected_node_admin_settings_submit($form, &$form_state) {
  $passwd = $form_state['values']['protected_node_global_password_field'];
  if ($passwd) {
    variable_set('protected_node_global_password', hash('sha256', $passwd));
    unset($form_state['values']['protected_node_global_password_field']);
    variable_del('protected_node_global_password_field');
  }

  // Never reset the password...
}