开发者

CakePHP authentication problem, allowedActions is not working

class CommentsController extends AppController {

    function beforeFilter() {
        parent::beforeFilter();     
      开发者_运维技巧  $this->Auth->allowedActions = array('add','edit');
    }

But if i do http://mysite.com/comments/view/13 i got error =>

 Error:  The action view is not defined in controller CommentsController

Error: Create CommentsController::view() in file: app/controllers/comments_controller.php.

<?php
class CommentsController extends AppController {

    var $name = 'Comments';


    function view() {

    }

}
?>

Notice: If you want to customize this error message, create app/views/errors/missing_action.ctp

And for http://mysite.com/comments/edit/13 =>

I got the edit page with that comment. That should not come. I should be prompted to login before editing any post.

Why isn't working ?


I got the edit page with that comment. That should not come. I should be prompted to login before editing any post.

remove the line $this->Auth->allowedActions = array('add','edit');

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜