App Controller (which could be served from database via a EAV style
settings model) then depending on the value you could override $this-
>Auth->allow(); declarations and maybe $this->Auth->loginScope(); if
you only wanted particular users/groups to be able to access the site.
You could also pass the variable to the login view to alter the login
required message reflecting that the site is in maintenance mode.
HTH, Paul
@phpMagpie
On Sep 5, 8: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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment