Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Too many redirects when login-user access the control they don't allow to go
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Budd  
View profile  
 More options Apr 24 2012, 10:52 am
From: Budd <buddf...@gmail.com>
Date: Tue, 24 Apr 2012 07:52:58 -0700 (PDT)
Local: Tues, Apr 24 2012 10:52 am
Subject: Too many redirects when login-user access the control they don't allow to go
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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lowpass  
View profile  
 More options Apr 24 2012, 2:57 pm
From: lowpass <zijn.digi...@gmail.com>
Date: Tue, 24 Apr 2012 14:57:54 -0400
Local: Tues, Apr 24 2012 2:57 pm
Subject: Re: Too many redirects when login-user access the control they don't allow to go

> $this->Auth->allow(array('login','logout'));

Don't include login here.

Also, do you have a login() method? If so, post that.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Budd  
View profile  
 More options Apr 24 2012, 4:22 pm
From: Budd <buddf...@gmail.com>
Date: Tue, 24 Apr 2012 13:22:33 -0700 (PDT)
Local: Tues, Apr 24 2012 4:22 pm
Subject: Re: Too many redirects when login-user access the control they don't allow to go
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lowpass  
View profile  
 More options Apr 24 2012, 4:37 pm
From: lowpass <zijn.digi...@gmail.com>
Date: Tue, 24 Apr 2012 16:37:03 -0400
Local: Tues, Apr 24 2012 4:37 pm
Subject: Re: Too many redirects when login-user access the control they don't allow to go
The login method is special and shouldn't be included in allow().


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
euromark  
View profile  
 More options Apr 24 2012, 4:49 pm
From: euromark <dereurom...@googlemail.com>
Date: Tue, 24 Apr 2012 13:49:34 -0700 (PDT)
Local: Tues, Apr 24 2012 4:49 pm
Subject: Re: Too many redirects when login-user access the control they don't allow to go

@cricket: but it shouldn't hurt either :)

Am Dienstag, 24. April 2012 22:37:03 UTC+2 schrieb cricket:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Budd  
View profile  
 More options Apr 24 2012, 5:20 pm
From: Budd <buddf...@gmail.com>
Date: Tue, 24 Apr 2012 14:20:06 -0700 (PDT)
Local: Tues, Apr 24 2012 5:20 pm
Subject: Re: Too many redirects when login-user access the control they don't allow to go
What is the best way to do it?

I am just making a simple website with login.

People need to login to see the data and they only can see the login
page if they are not login.

On Apr 24, 4:37 pm, lowpass <zijn.digi...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
euromark  
View profile  
 More options Apr 24 2012, 5:28 pm
From: euromark <dereurom...@googlemail.com>
Date: Tue, 24 Apr 2012 14:28:58 -0700 (PDT)
Local: Tues, Apr 24 2012 5:28 pm
Subject: Re: Too many redirects when login-user access the control they don't allow to go

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lowpass  
View profile  
 More options Apr 24 2012, 5:32 pm
From: lowpass <zijn.digi...@gmail.com>
Date: Tue, 24 Apr 2012 17:32:51 -0400
Local: Tues, Apr 24 2012 5:32 pm
Subject: Re: Too many redirects when login-user access the control they don't allow to go
True, it shouldn't. But I recall that there was a problem with it
being included with allow(). Perhaps it's been fixed.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lowpass  
View profile  
 More options Apr 24 2012, 5:34 pm
From: lowpass <zijn.digi...@gmail.com>
Date: Tue, 24 Apr 2012 17:34:51 -0400
Local: Tues, Apr 24 2012 5:34 pm
Subject: Re: Too many redirects when login-user access the control they don't allow to go

On Tue, Apr 24, 2012 at 5:28 PM, euromark <dereurom...@googlemail.com> wrote:
> maybe you are using an early cake version

It looks like at least 2.x:

if ($this->request->is('post')) {

Definitely information that should be included with any request here, though.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
euromark  
View profile  
 More options Apr 25 2012, 4:18 am
From: euromark <dereurom...@googlemail.com>
Date: Wed, 25 Apr 2012 01:18:16 -0700 (PDT)
Local: Wed, Apr 25 2012 4:18 am
Subject: Re: Too many redirects when login-user access the control they don't allow to go

yeah
but my proposal about correcting this redirect hasnt been applied right at
the beginning of 2.0 as far as I know

still, I think the main issue might be solvable by debugging the redirects


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »