You are here

function ajax_register_menu_site_status_alter in Ajax Login/Register 7.4

Implements hook_menu_site_status_alter().

File

./ajax_register.module, line 149

Code

function ajax_register_menu_site_status_alter(&$menu_site_status, $path) {

  // Disable offline mode for ajax response for User Login and User Pass forms'.
  if ($menu_site_status == MENU_SITE_OFFLINE) {
    if (user_is_anonymous()) {
      switch ($path) {
        case 'system/ajax':
          if (isset($_POST['form_id']) && in_array($_POST['form_id'], array(
            'user_login',
            'user_pass',
          ))) {
            $menu_site_status = MENU_SITE_ONLINE;
            break;
          }
      }
    }
  }
}