Thanks Marcin. I solve the problem by using $this->Auth->loginAction()
of the Auth Component.
On Aug 24, 9:02 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> C'mon man- do some searching. I suggest looking at the api at auth
> component properties.
> HTH
>
> 2008/8/24,mario<[EMAIL PROTECTED]>:
>
>
>
>
>
>
>
> > Hello,
>
> > How can I configure the Auth component so that
> > it will redirect me to the login action of my admins_controller
> > everytime someone access an unauthorized page?
>
> > I see that it redirects me to the login action of my user_controller
> > which I don't want to happen.
>
> > Here is a snippet of my app_controller.php
>
> > <?php
> > class AppController extends Controller {
> > var $components = array('Auth');
> > function beforeFilter()
> > {
> > $this->Auth->loginRedirect = array('controller' => 'mainpage',
> > 'action' => 'home');
> > $this->Auth->logoutRedirect = array('controller' => 'mainpage',
> > 'action' => 'home');
> > $this->Auth->allow('home');
> > $this->Auth->authorize = 'controller';
> > $this->set('loggedIn', $this->Auth->user('id'));
> > }
> > function isAuthorized()
> > {
> > return true;
> > }
> > }
> > ?>
>
> > Thanks,
>
> >Mario
>
> --
> Marcin Domanskihttp://kabturek.info
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---