Cakephp ACL 身份验证问题 - 我被锁定
我已经按照 CakePHP Cookbook ACL 教程
进行操作现在我只是尝试使用脚手架方法添加用户。我正在尝试转到 /users/add 但它总是将我重定向到登录屏幕,即使我已在 $this->Auth->allow('*');
添加code>beforeFilter() 暂时允许访问所有页面。我已经按照教程的要求在 UsersController
和 GroupsController
中完成了此操作。
下面是我的 UsersController
代码,我认为它是所有文件中最相关的。如果需要任何其他代码,请告诉我。
<?php
class UsersController extends AppController {
var $name = 'Users';
var $scaffold;
function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('*');
}
function login() {
//Auth Magic
}
function logout() {
//Leave empty for now.
}
}
?>
我想我已经基本遵循了教程,对于我可能缺少的内容有什么想法吗?
谢谢。我已经被困在这个问题上有一段时间了。 =(
I've followed the CakePHP Cookbook ACL tutorial
And as of right now I'm just trying to add users using the scaffolding method. I'm trying to go to /users/add but it always redirects me to the login screen even though I have added $this->Auth->allow('*');
in beforeFilter()
temporarily to allow access to all pages. I've done this in both the UsersController
and GroupsController
as the tutorial asked.
Below is my code for UsersController
which I think will be the most relevant of all the files. Let me know if any other piece of code is required.
<?php
class UsersController extends AppController {
var $name = 'Users';
var $scaffold;
function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('*');
}
function login() {
//Auth Magic
}
function logout() {
//Leave empty for now.
}
}
?>
I think I've pretty much followed the tutorial, any ideas as to what I may be missing?
Thanks. I've been stuck on this for a while. =(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在这里遵循了最新版本的教程:
http://book。 cakephp.org/view/1543/Simple-Acl-control-Application
然后我发现自己在登录和注销方面遇到问题。但是,添加以下几行后,我就设置好了!
在
users_controller.php
中:I followed the recent version of the tutuorial here:
http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
And then I found myself having issues with login and logout. However on adding the following lines, I was set ok!
in
users_controller.php
: