dongtong1226 2013-10-07 18:14
浏览 39
已采纳

ACL ERR_TOO_MANY_REDIRECTS

When user access unauthorized url in my application, CakePHP execute too many redirects.

I don't know why.

I try set the parameters unauthorizedRedirect and redirectUrl, but doesn't work.

AppController.php

public $components = array(
  'DebugKit.Toolbar',
  'Session',
  'Acl',
  'Auth' => array(
    'unauthorizedRedirect ' => false,
    'loginAction' => array('controller' => 'users', 'action' => 'login'),
    'authenticate' => array(
      'Form' => array(
        'userModel' => 'User',
        'fields' => array('username' => 'nickname', 'password' => 'password_hash')
      ),
    ),
    'authorize' => array(
      'Actions' => array('actionPath' => 'controllers/')
    )
    // 'authError' => 'This error shows up with the user tries to access a part of the website that is protected',
  )
);
  • 写回答

2条回答 默认 最新

  • dpdyh86002 2013-10-07 23:03
    关注

    Change this "actionPath" => "controllers/"

    into this "actionPath" => "Controllers/"

    I'm quite sure that you are on a case sensitive OS.

    Another thing to setup it's the "loginRedirect" and the "logoutRedirect" statements: at the moment, if you login into the users/login action you will be redirected to the same action again and again. For a testing purpose I'd recommend you to set both of them to the root just adding this to your code:

    'loginRedirect' => '/',
    'logoutRedirect' => '/'
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭