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
Page 1 of 1
afterValidate different from yii 1.2 and 1.1.10?
#2
Posted 27 March 2012 - 12:28 PM
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.
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.
#4
Posted 06 August 2012 - 03:55 AM
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
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;
}
Good Programming is 99% Sweet and 1% Coffee
Share this topic:
Page 1 of 1

Help












