Re: 'Site under maintenance' option
Please clarify what you mean by maintenance? - updating the site scripts? - updating the database? - other? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: 'Site under maintenance' option
You can look into https://github.com/awebdeveloper/cakephp-maintenance-mode On Tuesday, 6 September 2011 01:15:20 UTC+5:30, Xoubaman 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? > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: 'Site under maintenance' option
This solution is simple and works fine for me. http://perishablepress.com/press/2010/05/19/htaccess-redirect-maintenance-page-site-updates/ On Sep 5, 9:45 pm, Xoubaman 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
Re: 'Site under maintenance' option
I like this idea. On Sep 13, 7:25 pm, Juan Basso wrote: > You can use a non-cake solution that is use htaccess (or any rewrite > rule from different http server) that check if file app/webroot/ > maintenance.html is present. If is there, show the file to any > request. So you can delete/create/rename the maintenance file to > enable/disable. Faster :) > > Juan Basso > > On Sep 13, 7:28 pm, ecsyle wrote: > > > > > > > > > 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 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
Re: 'Site under maintenance' option
You can use a non-cake solution that is use htaccess (or any rewrite rule from different http server) that check if file app/webroot/ maintenance.html is present. If is there, show the file to any request. So you can delete/create/rename the maintenance file to enable/disable. Faster :) Juan Basso On Sep 13, 7:28 pm, ecsyle wrote: > 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 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
Re: 'Site under maintenance' option
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 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
Re: 'Site under maintenance' option
I mean is my second option. I'm Spanish and made a literal translation of a Spanish expression, maybe it isn't correct in English. -- 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
Re: 'Site under maintenance' option
can u explain me that what is B plan On Sat, Sep 10, 2011 at 1:51 AM, Xoubaman wrote: > Ip ranges is my B plan, but could be a problem with non-tech skilled admin > users login from dinamic ips. > > I will come to this point later, so thanks for the answers, hope I can find > a good solution. > > -- > 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 > -- 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
Re: 'Site under maintenance' option
Ip ranges is my B plan, but could be a problem with non-tech skilled admin users login from dinamic ips. I will come to this point later, so thanks for the answers, hope I can find a good solution. -- 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
Re: 'Site under maintenance' option
You could restrict it by client ip so that only the blessed ones can connect from a specific set of ip's to the login page. Then you don't have to worry about a secret url you can do the check on the client ip in App_controller and allow/deny and redirect with normal cake process before they ever see the login page. Post a note on the Login page so other admins who are allowed to see the login because they meet the special ip's know the site is in maintenance mode. If you do this I would also only allow admins who are connected from the specific set of ip's to set the site to maintenance mode. Or on the page to set the site to maintenance mode allow adding the current client ip as a valid connection site. It would suck to have to drive into the office because you set the site to maintenance mode while connected from an ip that wouldn't let you login to turn maintenance back off. On Sep 7, 9:30 am, Xoubaman wrote: > I want that, when site is disabled, nobody will reach the login form > whatever they do, unless the blessed ones who know the secret-and-only-path > to do so. If everytime an user try to do some action that requires to be > logged in, he's redirected to log in screen, the site won't look really > disabled. > > The disabled boolean is read from database and loaded by a configuration > helper (WebThecnick configuration plugin), that loads configuration values > at the very beginning of AppController::beforeFilter, so secret route won't > be available at routes.php. -- 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
Re: 'Site under maintenance' option
I want that, when site is disabled, nobody will reach the login form whatever they do, unless the blessed ones who know the secret-and-only-path to do so. If everytime an user try to do some action that requires to be logged in, he's redirected to log in screen, the site won't look really disabled. The disabled boolean is read from database and loaded by a configuration helper (WebThecnick configuration plugin), that loads configuration values at the very beginning of AppController::beforeFilter, so secret route won't be available at routes.php. -- 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
Re: 'Site under maintenance' option
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 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
Re: 'Site under maintenance' option
Quickly off the top of my head I would set a boolean variable in my 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 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