Answer the question
In order to leave comments, you need to log in
Where in Yii to create a UserIdentity class and call its authenticate method?
Good afternoon, help people who studied this article by Makarov www.yiiframework.ru/doc/guide/ru/topics.auth
It doesn't say where or instead of what to insert this piece in order for authorization to work.
// Аутентифицируем пользователя по имени и паролю
$identity=new UserIdentity($username,$password);
if($identity->authenticate())
Yii::app()->user->login($identity);
else
echo $identity->errorMessage;
…
// Выходим
Yii::app()->user->logout();
Answer the question
In order to leave comments, you need to log in
To the protected/components directory. And make sure that the config is written
'import' => array (
...
'application.components.*'
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question