web\User getIdentityAndDurationFromCookie()

getIdentityAndDurationFromCookie() protected method (available since version 2.0.9) Determines if an identity cookie has a valid format and contains a valid auth key. This method is used when $enableAutoLogin is true. This method attempts to authenticate a user using the information in the identity cookie. See also loginByCookie(). protected array|null getIdentityAndDurationFromCookie ( )return array|null Returns an array of 'identity' and 'duration' if valid, otherwise null.

web\User getAccessChecker()

getAccessChecker() protected method (available since version 2.0.9) Returns the access checker used for checking access. protected yii\rbac\CheckAccessInterface getAccessChecker ( )

web\User getAuthManager()

getAuthManager() protected method (available since version 2.0.6) Returns auth manager associated with the user component. By default this is the authManager application component. You may override this method to return a different auth manager instance if needed. protected yii\rbac\ManagerInterface getAuthManager ( )

web\User getId()

getId() public method Returns a value that uniquely represents the user. See also getIdentity(). public string|integer getId ( )return string|integer The unique identifier for the user. If null, it means the user is a guest.

web\User checkRedirectAcceptable()

checkRedirectAcceptable() protected method (available since version 2.0.8) Checks if the Accept header contains a content type that allows redirection to the login page. The login page is assumed to serve text/html or application/xhtml+xml by default. You can change acceptable content types by modifying $acceptableRedirectTypes property. See also $acceptableRedirectTypes. protected boolean checkRedirectAcceptable ( )return boolean Whether this request may be redirected to the login page.

web\User can()

can() public method Checks if the user can perform the operation as specified by the given permission. Note that you must configure "authManager" application component in order to use this method. Otherwise it will always return false. public boolean can ( $permissionName, $params = [], $allowCaching = true )$permissionName string The name of the permission (e.g. "edit post") that needs access check. $params array Name-value pairs that would be passed to the rules associated with the r

web\User beforeLogout()

beforeLogout() protected method This method is invoked when calling logout() to log out a user. The default implementation will trigger the EVENT_BEFORE_LOGOUT event. If you override this method, make sure you call the parent implementation so that the event is triggered. protected boolean beforeLogout ( $identity )$identity yii\web\IdentityInterface The user identity information return boolean Whether the user should continue to be logged out

web\User beforeLogin()

beforeLogin() protected method This method is called before logging in a user. The default implementation will trigger the EVENT_BEFORE_LOGIN event. If you override this method, make sure you call the parent implementation so that the event is triggered. protected boolean beforeLogin ( $identity, $cookieBased, $duration )$identity yii\web\IdentityInterface The user identity information $cookieBased boolean Whether the login is cookie-based $duration integer Number of seconds that the

web\User $returnUrl

$returnUrl public property The URL that the user should be redirected to after login. public string getReturnUrl ( $defaultUrl = null )public void setReturnUrl ( $url )

web\User afterLogout()

afterLogout() protected method This method is invoked right after a user is logged out via logout(). The default implementation will trigger the EVENT_AFTER_LOGOUT event. If you override this method, make sure you call the parent implementation so that the event is triggered. protected void afterLogout ( $identity )$identity yii\web\IdentityInterface The user identity information