Answer the question
In order to leave comments, you need to log in
Authentication in Yii. as?
Hello. I'm studying the Yii tutorial, I had a problem with authentication.
As it is written in the manual, I created the tbl_user table, we are preparing the sql script (which came with yii) and threw 21 users there with username = test$i and password = pass$i.
After reading this guide, I did not understand what to do with this
$identity=new UserIdentity($username,$password);
$identity->authenticate();
switch($identity->errorCode)
{
case UserIdentity::ERROR_NONE:
Yii::app()->user->login($identity);
break;
…
}
public function hashPassword($password)
{
return CPasswordHelper::hashPassword($password);
}
, but the result is 0 Answer the question
In order to leave comments, you need to log in
I advise you to read more about Yii.
And the code that you cited above about identity is the code used in the model.
See code examples of how it is implemented https://github.com/yiisoft/yii/tree/master/demos/b...
And about the hashPassword method, it does not cache, but creates an md5 hash, not to store the password in clear text
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question