You are here

function protected_pages_edit_submit in Protected Pages 7.2

Same name and namespace in other branches
  1. 7 protected_pages.admin.inc \protected_pages_edit_submit()

Implements hook_submit().

File

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

Code

function protected_pages_edit_submit($form, &$form_state) {
  $values['path'] = check_plain($form_state['values']['path']);
  if (!empty($form_state['values']['password'])) {
    $values['password'] = sha1(trim(check_plain($form_state['values']['password'])));
  }
  db_update('protected_pages')
    ->fields($values)
    ->condition('pid', $form_state['values']['pid'])
    ->execute();
  drupal_set_message(t('The protected page settings have been successfully saved.'));
  $form_state['redirect'] = 'admin/config/system/protected_pages';
}