I have a boolean set in my AppController to enable/disable the site.
If the site is disabled, I run $this->cakeError('maintenance') to send
the user to a custom error page explaining that the site is down for
maintenance.

I also use a .lock file in the webroot to automatically disable the
site when I am doing updates. My build script creates the .lock file
before doing anything else, and once the updates are complete and
verified, the .lock file is removed.


On Sep 5, 12:45 pm, Xoubaman <xouba...@gmail.com> wrote:
> I'm trying to implement a system to disable the site temporaly for
> maintenance purposes or whatever. If the site is disabled, only logged users
> can navigate through it, non-logged users are redirected to a "Site under
> maintenance" layout.
>
> Currently (o "As of now"), my approach is to allow a "secret url" that will
> lead to the login form, check in AppController::beforefilter if the current
> url is the allowed one and, if it isn't, set the maintenance layout. Trying
> to figure out how to allow only one url to log in, I came to define it as a
> constant in bootstrap and add the route in config/routes pointing to
> UsersController::login.
>
> It would be nice to save the secret url into the database and change it
> without editing bootstrap.php, though.
>
> Any suggestion?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to