我在我的应用程序中使用 ACL。我在 AppController 的 beforeFilter 中定义了我的 loginAction,但它仍然没有重定向到正确的位置。我想做的是当用户像这样访问应用程序时 - localhost/intraweb 它必须重定向到 localhost/intraweb/users/login
这是我的 AppController 代码
class AppController extends Controller {
public $helpers = array('Html', 'Form', 'CustomFields.Field');
public $components = array(
'CustomFields.Field',
'Acl',
'Auth' => array(
'authorize' => array(
'Actions' => array('actionPath' => 'controllers')
)
),
'Session',
'Cookie',
);
public $uses = array('User');
public function beforeFilter() {
//Configure AuthComponent
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
$this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'login');
$this->Auth->allow('display');
//OTHER CODE
}
这是我的 PagesController 代码
class PagesController extends AppController {
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow();
}
//Other code
有谁知道为什么它不重定向到用户/登录页面?
先感谢您