afterValidate different from yii 1.2 and 1.1.10?

i am using yii 1.1.10, and i want to know if its book mistake or because the yii version different

in the user model

he say to override the afterValidate()

function to encrypt the password in md5

the problem is that the afterValidate function is called even when the validate is failed

so if for example the user put not email in the email field and then the validate failed,

the password field will contain the md5 password and not the original password the user entered

so i changes the afterValidate() to beforeSave() am i right? it is because different yii version? thanks

I don’t think it is different.

You could check by running your app with yii 1.2 t compare. You can also check the changelogs to see if something like this has been changed.

so i am right? is a little ‘bug’ in the book?

in ebook alot of things are missing, thats what is called incomplete tutorials with errors…

login to User model not working , i did same and repeated exactly same, this encrtion is also not working

i am using this and working fine in USER MODEL


	//this function encrypts password to md5 encryption

    	public function beforeSave()

        {

		$pass = md5($this->password);

	        $this->password = $pass;

        	return true;

        }