Hey cakeFreak,
I have a slightly different approach for development bypassing. I
have a condition like
if (Config::read()) {
$this->Auth->allow();
}
This checks if CAKE_DEBUG is greater than 0 and bypass authentication
and authorization.
Personally I think it is safer than the extra property way that you
have shown cause you may forget to turn it off, whereas with using
DEBUG you will notice when you forget to turn it off when debug
statements and sql logs start showing up :)
Geoff
--
http://lemoncake.wordpress.com
On Jul 20, 7:22 pm, cakeFreak <[EMAIL PROTECTED]> wrote:
> Hey Geoff Ford,
>
> cheers for the tutorial!
>
> Great!
>
> I just modified a bit you beforeFilter function in the AppController
> to basically allow access to all controllers during development with
> ease!
>
> -----------------------------------------------------------------------------------------------------------------------------------------
> function beforeFilter(){
> if (isset($this->Auth)) {
> $this->Auth->userScope = array('User.disabled' => 0);
> $this->Auth->loginAction = '/users/login';
> $this->Auth->loginRedirect = '/users/account';
> $this->Auth->fields = array('username' => 'username',
> 'password' => 'passwrd');
> $this->Auth->authorize = 'actions';
>
> if(!$this->inDev){
> if (in_array(low($this->params['controller']), $this-
>
> >publicControllers)) {
>
> $this->Auth->allow();
> }
> }
> else{
> $this->Auth->allow('*');
> }
> }
> }
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> Then in your App controller you set:
>
> var $inDev = true; //true if your are in development phase / false if
> the app is live
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---