[development] Put a site into maintenance-mode, but not for all...

Gábor Hojtsy gabor at hojtsy.hu
Tue Jan 6 13:27:45 UTC 2009


Hi,

I prefer whitelisting IPs in .htaccess via Apache setup, so that while
you experiment, nobody will get to the site (PHP code) any way, but
only those allowed.

Gábor

On Tue, Jan 6, 2009 at 2:25 PM, Jens Reinemuth <jens at reinemuth.info> wrote:
> 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