Why a secret url?
It could be just check if it's maintenance and if user is logged in.
If not, redirect to login action.

If your login action is too secret:
You also need an maintenance switch (which should be also in DB, if
you're switching to maintenance by editing files then you can edit
secret url also ;) ) so you have to have some Config/Setting model (or
just implement/google one).

Something like this: 
http://bakery.cakephp.org/articles/iamcam/2008/10/26/simply-storing-config-values-in-the-db
or anyone that suits your needs.

Your routes.php can have:
Router::connect(Configure::read('Secret.url'),
    array('controller' => 'users', 'action' => 'secret_login'));
- or -
Router::connect(ClassRegistry::init('Config')->field('value',
array('key' => 'secret_url')),
    array('controller' => 'users', 'action' => 'secret_login'));


On Sep 5, 9: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