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:
<span style="color: #000000"><span style="color: #0000BB"><?php<br></span><span style="color: #007700">function </span><span style="color: #0000BB">ajax_register_fix_menu_site_status_alter</span><span style="color: #007700">(&</span><span style="color: #0000BB">$menu_site_status</span><span style="color: #007700">, </span><span style="color: #0000BB">$path</span><span style="color: #007700">) {<br> if (</span><span style="color: #0000BB">$menu_site_status </span><span style="color: #007700">== </span><span style="color: #0000BB">MENU_SITE_OFFLINE </span><span style="color: #007700">&& </span><span style="color: #0000BB">user_is_anonymous</span><span style="color: #007700">() && </span><span style="color: #0000BB">$path </span><span style="color: #007700">== </span><span style="color: #DD0000">'ajax_register/register'</span><span style="color: #007700">) {<br> </span><span style="color: #0000BB">$menu_site_status </span><span style="color: #007700">= </span><span style="color: #0000BB">MENU_SITE_ONLINE</span><span style="color: #007700">;<br> }<br>}<br></span><span style="color: #0000BB">?></span></span>
This is content of ajax_register_fix.module custom module.
Blog tags: