Sunday, October 30, 2011

Question about login function (cakephp 2.0)

Hello everybody,

i try cakephp 2.0 and the login sequence is very diffrent to cakephp
1.3.

In 1.3 its "magic" and you can type function login(){}

In 2.0 i must write a bit more:

public function login() {
if ($this->Auth->login()) {
$this->redirect($this->Auth->redirect());
} else {
$this->Session->setFlash(__('Invalid username or password, try
again'));
}
}

Now i have the problem when i open /users/login i have always the
flash message.

What is the correct way to set the message only when i submit?

Thank you!

gloop

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: