You are here

function protected_pages_configure_submit_callback in Protected Pages 7

Same name and namespace in other branches
  1. 7.2 protected_pages.admin.inc \protected_pages_configure_submit_callback()

Ajax submit callback for add protected page form.

1 string reference to 'protected_pages_configure_submit_callback'
protected_pages_configure in ./protected_pages.admin.inc
Callback function for add protected page.

File

./protected_pages.admin.inc, line 133
Provides page callbacks for configuration page.

Code

function protected_pages_configure_submit_callback($form, &$form_state) {
  $errors = form_get_errors();
  if (count($errors) < 1) {
    db_insert('protected_pages')
      ->fields(array(
      'password' => sha1(trim(check_plain($form_state['values']['password']))),
      'path' => check_plain($form_state['values']['path']),
    ))
      ->execute();
    drupal_set_message('The protected page settings has been successfully saved.');
    $form['rules_list']['pages_table']['#markup'] = protected_pages_get_pages_list();
    $form['rules_list']['path']['#value'] = '';
  }
  return $form['rules_list'];
}