On Tue, Apr 24, 2012 at 10:52 AM, Budd <buddf...@gmail.com> wrote: > Hi,
> I have setup ACL component and everything looks fine. But only one > problem.
> If i am not login and access some permission denied page, it will > redirect me to login page
> If i am login to basic user and access some permission denied page, it > will show up the error page "Too many redirects".
> I don't know which path it was point to and keep looping, any way to > show it?
> I added this to my app controller
> $this->Auth->loginError = "Wrong credentials. Please provide a > valid username and password."; > $this->Auth->authError = "You don't have sufficient privilege > to access this resource."; > $this->Auth->loginAction = array('controller' => 'users', > 'action' => 'login'); > $this->Auth->logoutRedirect = array('controller' => 'users', > 'action' => 'login'); > $this->Auth->loginRedirect = array('controller' => > 'adcontents', 'action' => 'index');
> The users controller i added: > function beforeFilter() { > parent::beforeFilter(); > $this->Auth->allow(array('login','logout')); > }
> I don't know how i can fix this problem as i didn't redirect to > somewhere else. It is only happen when i login to basic user not > public user.
> I already spent couple of hours to figure it out. But i have still no > cue
> Thank you.
> -- > 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
public function login() {
if ($this->request->is('post')) {
if ($this->Auth->login()) {
$this->Session->setFlash(__('Login Success'));
$this->redirect($this->Auth->redirect());
} else {
$this->Session->setFlash(__('Invalid username or password,
try again'));
}
}
}
If no login, nobody can access login page, no?
On Apr 24, 2:57 pm, lowpass <zijn.digi...@gmail.com> wrote:
> > The users controller i added:
> > function beforeFilter() {
> > parent::beforeFilter();
> > $this->Auth->allow(array('login','logout'));
> > }
> > I don't know how i can fix this problem as i didn't redirect to
> > somewhere else. It is only happen when i login to basic user not
> > public user.
> > I already spent couple of hours to figure it out. But i have still no
> > cue
> > Thank you.
> > --
> > Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://groups.google.com/group/cake-php
>> > The users controller i added:
>> > function beforeFilter() {
>> > parent::beforeFilter();
>> > $this->Auth->allow(array('login','logout'));
>> > }
>> > I don't know how i can fix this problem as i didn't redirect to
>> > somewhere else. It is only happen when i login to basic user not
>> > public user.
>> > I already spent couple of hours to figure it out. But i have still no
>> > cue
>> > Thank you.
>> > --
>> > Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org >> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
> >> > The users controller i added: > >> > function beforeFilter() { > >> > parent::beforeFilter(); > >> > $this->Auth->allow(array('login','logout')); > >> > }
> >> > I don't know how i can fix this problem as i didn't redirect to > >> > somewhere else. It is only happen when i login to basic user not > >> > public user.
> >> > I already spent couple of hours to figure it out. But i have still no > >> > cue
> >> > Thank you.
> >> > -- > >> > Our newest site for the community: CakePHP Video Tutorialshttp:// > tv.cakephp.org > >> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd > 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 athttp://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+unsubscribe@googlegroups.com For more options, visit this > group at http://groups.google.com/group/cake-php
> >> > The users controller i added:
> >> > function beforeFilter() {
> >> > parent::beforeFilter();
> >> > $this->Auth->allow(array('login','logout'));
> >> > }
> >> > I don't know how i can fix this problem as i didn't redirect to
> >> > somewhere else. It is only happen when i login to basic user not
> >> > public user.
> >> > I already spent couple of hours to figure it out. But i have still no
> >> > cue
> >> > Thank you.
> >> > --
> >> > Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org > >> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 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 athttp://groups.google.com/group/cake-php
> > --
> > Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://groups.google.com/group/cake-php
from the look at your code I can see nothing wrong so far try to debug redirect() and find out what it tries to redirect to - e.g. using $this->log()
maybe you are using an early cake version where you would get redirected to the homepage (/) instead of your loginRedirect in such a case. if this url then isnt public or redirecfts you back to the referer you might run into such an endlessloop. hard to say from the above code pieces
Am Dienstag, 24. April 2012 23:20:06 UTC+2 schrieb Budd:
>> >> > The users controller i added:
>> >> > function beforeFilter() {
>> >> > parent::beforeFilter();
>> >> > $this->Auth->allow(array('login','logout'));
>> >> > }
>> >> > I don't know how i can fix this problem as i didn't redirect to
>> >> > somewhere else. It is only happen when i login to basic user not
>> >> > public user.
>> >> > I already spent couple of hours to figure it out. But i have still no
>> >> > cue
>> >> > Thank you.
>> >> > --
>> >> > Our newest site for the community: CakePHP Video
>> >> > Tutorialshttp://tv.cakephp.org >> >> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd >> >> > 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 athttp://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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php