You are here

function path_access_admin_configure_form_validate in Path Access 7

Same name and namespace in other branches
  1. 6 path_access.module \path_access_admin_configure_form_validate()

Validate role access form submission.

File

./path_access.module, line 182
Restricts access to any Drupal path on a per-role basis.

Code

function path_access_admin_configure_form_validate($form_id, &$form_state) {
  if ($form_state['values']['visibility'] == 0) {

    // Prevent protected pages from being listed.
    $pages = explode("\n", $form_state['values']['pages']);
    foreach ($pages as $page) {
      if (path_access_protected_pages($page)) {
        form_set_error('pages', t('You cannot block access to the %protected page.', array(
          '%protected' => $page,
        )));
      }
    }
  }

  // else ... do we *require* that each protected page be visible?
}