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.
- Username and Password = correct but Status = pending
- 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.
精彩评论