Fix to authError getting displayed before login.

pull/61/head
noud 2012-07-11 10:19:57 +02:00
parent 50e24c7c56
commit e67d9ebdec
1 changed files with 5 additions and 1 deletions

View File

@ -231,7 +231,11 @@ class UsersController extends AppController {
if ($this->Auth->login()) {
$this->redirect($this->Auth->redirect());
} else {
// don't display "invalid user" before first login attempt
// don't display authError before first login attempt
if (str_replace("//","/",$this->webroot.$this->Session->read('Auth.redirect')) == $this->webroot && $this->Session->read('Message.auth.message') == $this->Auth->authError) {
$this->Session->delete('Message.auth');
}
// don't display "invalid user" before first login attempt
if($this->request->is('post')) $this->Session->setFlash(__('Invalid username or password, try again'));
}