Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9233749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:37:35+00:00 2026-06-18T06:37:35+00:00

I am trying to implement the ACL tutorial found here: http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html I followed all

  • 0

I am trying to implement the ACL tutorial found here:
http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html

I followed all the instructions, however when I try to go to [my_site]/users/add ERR_TOO_MANY_REDIRECTS error.

I found this on the Cakephp website:

This happens when for example we have an element that receives data
from a method of a controller, and the implementation of this method
requires conducting the login would create an infinite loop that
eventually will cause the browser to decline redirects

And they suggest this as the fix:

function  beforeFilter ()  { 
 $ this -> Auth -> allow ( 'CONTROLLER_NAME' ); 
}

Which doesn’t seem to work.

If I change the AppController from this:

public function beforeFilter() {
    $this->Auth->allow('index', 'view', 'login', 'add');
}

to:

public function beforeFilter() {
    $this->Auth->allow('*');
}

I dont get the error anymore but get redirected to [my_site]/users/login

Any suggestions as to what I am doing wrong that I can’t view the User-Add page?
TIA!

UserController:

public function beforeFilter() {
        parent::beforeFilter();
        $this->Auth->allow('add');
    }

Login function (UsersController):

Public function login() {
    if ($this->request->is('post')) {
        if ($this->Auth->login()) {
            $this->redirect($this->Auth->redirect());
        } else {
            $this->Session->setFlash(__('Invalid username or password, try again'));
        }
    }
}

Auth Component Loader:

public $components = array(
        'Session',
        'RequestHandler',
        'Auth' => array(
            'loginRedirect' => array('controller' => 'projects', 'action' => 'index'),
            'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'home')
        )
    );
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:37:36+00:00Added an answer on June 18, 2026 at 6:37 am

    I finally managed to solve the problem with help Brian:

    Do you have an requestAction() code? If so, try adding this in

    AppController::beforeFilter() 
    
    if (isset($this->params['requested'])) $this->Auth->allow($this->action); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to implement a sphere example code I found here on stackoverflow I have
I implemented security according to the acl tutorial on the www.cakephp.org website. I'm trying
Just trying to implement these buttons at the moment: http://web.archive.org/web/20110721191046/http://particletree.com/features/rediscovering-the-button-element/ Can't decide which to
I'm trying to implement an ACL and I would like your opinion about which
Trying to implement google C2DM service. registrationIntent.putExtra(app, PendingIntent.getBroadcast(context,0,new Intent(), 0)); registrationIntent.putExtra(sender,example@gmail.com); context.startService(registrationIntent); Almost every
Trying to implement a search similar to here .This searches properties based on city,locality,property
Trying to implement search functionality in list view having problem in search,here i am
I'm trying to implement spring security acl into a project. After building the main
Trying to implement this gallery on my website. http://coffeescripter.com/code/ad-gallery/ It is noted in the
I am trying to implement zend ACL in my project, i am facing three

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.