You are here

function ajax_register_page_access in Ajax Login/Register 7.4

Check access to ajax page callback.

1 string reference to 'ajax_register_page_access'
ajax_register_menu in ./ajax_register.module
Implements hook_menu().

File

./ajax_register.module, line 33

Code

function ajax_register_page_access($form, $type) {
  $allowed_forms = array(
    'login',
    'register',
    'password',
  );
  $allowed_types = array(
    'ajax',
    'nojs',
  );
  if (in_array($form, $allowed_forms) && in_array($type, $allowed_types) && user_is_anonymous()) {
    return TRUE;
  }
  return FALSE;
}