Revision #2 has been created by whoopass on Mar 5, 2013, 6:45:32 PM with the memo:
Added image of custom error example.
« previous (#1)
Custom Login Error Messages
custom error, login, LoginForm, UserIdentity, error message, errorCode, addError
[...]$this->addError('username', 'Username is currently not active, please activate using the activation URL in your email and try again.');
One final thing to note is that the addError pulls an attribute value first, here you see 'username' or 'password'. These reference to which field to show the error under. In our case with our custom value we know the user authenticates properly and exist in our DB, they just haven't activated their account yet. As such we label the error to the 'username'.
That's it for the tutorial, I hope you learned a lot in understanding how to follow the logical flow of code assignments and debugging the functions, variables and classes in this case. I also hope this helps you put to good use how to modify your own custom errors into the login authentication process.
Thanks for reading!