When I log in to the site is not an active user - the input works well. That is, when I entered, I was thrown to
http://site.ru/my and writes that you are not activated. But when I enter as activated - it flips to
http://site.ru/my and writes that access is denied, you need to log in. I do a check through
Yii::$app->user->isGuest That is, in the first result it returns 0, and in the second - 1. Why?
true(1) will return to us, if he is authenticated,false(0) will return accordingly. But without information about where, how and why you have it checked it is difficult to say exactly where you got confused. - Blacknifestatus=10, that is, he is not active. This method returns 0 after I login. I do not log out from the system, but I simply changestatus=13in the database, that is, I make it active, reload the page and this method returns 1. so I can not understand why? - DiefairfindIdentitymethod, where a user with the specified status is searched, changing thestatusdatabase to '13', change it in the method, and then understand how it works - Blacknifepublic static function findIdentity($id) { return static::findOne($id); }public static function findIdentity($id) { return static::findOne($id); }- DiefairisGuestmethod - the guest says or not the guest, and he doesn’t care what you have in the database, 10 or 13, whether the user is logged in or not. And the message - "access denied" means that the user has logged in (isGuest returns 0), but he does not have rights to the action. We look towards access control. - Bookin