doukanhua0752 2013-07-19 07:51
浏览 62

index.php YII中的ERR_TOO_MANY_REDIRECTS

I have to close access to my index.php main page, I modified siteController.php with following code:

public function accessRules() {
  return array(
    // allow all users to perform 'index' and 'view' actions *
    array('allow',
      'actions' => array('index','view'),
      'users' => array('admin'),
    ),
    // allow authenticated user to perform 'create' and 'update' actions @
    array('allow',
      'actions' => array('create','update'),
      'users' => array('admin'),
    ),
    // allow admin user to perform 'admin' and 'delete' actions
    array('allow',
      'actions' => array('admin','delete'),
      'users' => array('admin'),
    ),
    // deny all users
    array('deny',
      'users' => array('*'),
    ),
  );
}

Because I have to give access only for admin. After this manipulations I saw that redirect is working, and url becomes index.php/site/login, but instead of login/pass form I got ERR_TOO_MANY_REDIRECTS. Hope you could understand me)

  • 写回答

3条回答 默认 最新

  • dongzha0813 2014-08-29 14:48
    关注

    I had same problem and the solution is to add the "error" action to the rules, allowing all users to access it. I got into this because after doing an update it generated an error and the error action couldn't be accessed.

    评论

报告相同问题?

悬赏问题

  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用