[development] Put a site into maintenance-mode, but not for all...
Jens Reinemuth
jens at reinemuth.info
Tue Jan 6 13:25:34 UTC 2009
Hi @all...
i try to figure out how to put a live website into the maintenance-mode,
but leave it fully accessible by a fixed IP-Range of developers so that
bugs can be fixed and tested in a fully running site...
Drupal V5.x...
My way would be a modification of menu.inc:
--snip--
function menu_execute_active_handler() {
$client = $_SERVER['REMOTE_ADDR'];
$arrAllowed = array ('www.xxx.yyy.zzz','127.0.0.1');
if (_menu_site_is_offline() && !in_array($client,$arrAllowed)) {
return MENU_SITE_OFFLINE;
}
--/snip--
the array is just in there for testing purposes, will be replaced by a
GLOBAL or something like that...
Is this the only way to do it (as after an update menu.inc could be
replaced...) ?
Jens
More information about the development
mailing list