开发者

Cakephp Auth: $this->Auth->loginError message

I am using Auth Component. I am setting $this->Auth->loginError in the beforeFilter. But i have another posibility. If the user entered username and password is correct but User.status = 'pending' how can i can show a different message. i am using $this->Auth->userScope to set that. but how to show different $this->Auth->loginError for these t开发者_运维百科wo posibilities.

  1. Username and Password = correct but Status = pending
  2. Either Username or Password = incorrect but status = active

there are the two posibilities.


Check out the autoRedirect property

If you set this to false, you can add some additional logic to the login method in the controller for the model you're using for authentication. Here you can make the check for the account status and deliver the custom message for the active vs. pending accounts. You'll have to set redirects manually in the method when autoRedirect is off.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜