I have following login code:
if ($logged == true) {
HTTP::redirect('profile/private');
} else {
$validation = Validation::factory($_POST)
->rule('username', 'not_empty')
->rule('password', 'not_empty');
if ($validation->check()) {
}
$errors = $validation->errors('login');
The case here is if no username is entered, the proper message will be sown (I have messages in login.php file in messages folder for example: 'username' => array('not_empty' => 'Field :field can not be empty', the same for password field). And theese two rules are working properly with errors. But when both username and password are given and user is not authenticated as 'valid' (for example wrong password or mistyped username) I need one custom error message (for example: 'Check username or password, Maybe CAPSLOCK is pressed'). How to achieve this? What with error message i don't want it to be related with just one field like all messages in login.php field. Please help