Vasyl Yaremchuk

Turn off maintenance mode on separate paths in Drupal 7

We have faced with the problem. We use Ajax Login/Register module but put site in Maintenance mode.

But we need to have Sign up ability. Ajax Register module show Sign up form in popup, content is requested from "ajax_register/register". But in maintenance mode we can see Maintenance page response…

But fortunately we have hook_menu_site_status_alter. Thus we can turn off Maintenance mode in our module on separate path:

<?php
function ajax_register_fix_menu_site_status_alter(&$menu_site_status, $path) {
  if ($menu_site_status == MENU_SITE_OFFLINE && user_is_anonymous() && $path == 'ajax_register/register') {
    $menu_site_status = MENU_SITE_ONLINE;
  }


?>

This is content of ajax_register_fix.module custom module.