Class lispa\amos\core\user\AmosUser
Inheritance | lispa\amos\core\user\AmosUser » yii\web\User » yii\base\Component » yii\base\Object |
---|---|
Implements | yii\base\Configurable |
Class AmosUser
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$absoluteAuthTimeout | integer | The number of seconds in which the user will be logged out automatically regardless of activity. | yii\web\User |
$absoluteAuthTimeoutParam | string | The session variable name used to store the value of absolute expiration timestamp of the authenticated state. | yii\web\User |
$acceptableRedirectTypes | array | MIME types for which this component should redirect to the $loginUrl. | yii\web\User |
$accessChecker | yii\rbac\CheckAccessInterface | The access checker to use for checking access. | yii\web\User |
$authTimeout | integer | The number of seconds in which the user will be logged out automatically if he remains inactive. | yii\web\User |
$authTimeoutParam | string | The session variable name used to store the value of expiration timestamp of the authenticated state. | yii\web\User |
$autoRenewCookie | boolean | Whether to automatically renew the identity cookie each time a page is requested. | yii\web\User |
$behaviors | yii\base\Behavior[] | List of behaviors attached to this component | yii\base\Component |
$enableAutoLogin | boolean | Whether to enable cookie-based login. | yii\web\User |
$enableSession | boolean | Whether to use session to persist authentication status across multiple requests. | yii\web\User |
$id | string|integer | The unique identifier for the user. | yii\web\User |
$idParam | string | The session variable name used to store the value of $id. | yii\web\User |
$identity | yii\web\IdentityInterface|null | The identity object associated with the currently logged-in user. | yii\web\User |
$identityClass | lispa\amos\core\user\AmosUser | ||
$identityCookie | array | The configuration of the identity cookie. | yii\web\User |
$isGuest | boolean | Whether the current user is a guest. | yii\web\User |
$loginUrl | string|array | The URL for login when loginRequired() is called. | yii\web\User |
$returnUrl | string | The URL that the user should be redirected to after login. | yii\web\User |
$returnUrlParam | string | The session variable name used to store the value of $returnUrl. | yii\web\User |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\Component |
__clone() | This method is called after the object is created by cloning an existing one. | yii\base\Component |
__construct() | Constructor. | yii\base\Object |
__get() | Returns the value of a component property. | yii\base\Component |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\Component |
__set() | Sets the value of a component property. | yii\base\Component |
__unset() | Sets a component property to be null. | yii\base\Component |
attachBehavior() | Attaches a behavior to this component. | yii\base\Component |
attachBehaviors() | Attaches a list of behaviors to the component. | yii\base\Component |
behaviors() | Returns a list of behaviors that this component should behave as. | yii\base\Component |
can() | lispa\amos\core\user\AmosUser | |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\Component |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\Component |
className() | Returns the fully qualified name of this class. | yii\base\Object |
detachBehavior() | Detaches a behavior from the component. | yii\base\Component |
detachBehaviors() | Detaches all behaviors from the component. | yii\base\Component |
ensureBehaviors() | Makes sure that the behaviors declared in behaviors() are attached to this component. | yii\base\Component |
getBehavior() | Returns the named behavior object. | yii\base\Component |
getBehaviors() | Returns all behaviors attached to this component. | yii\base\Component |
getId() | Returns a value that uniquely represents the user. | yii\web\User |
getIdentity() | Returns the identity object associated with the currently logged-in user. | yii\web\User |
getIsGuest() | Returns a value indicating whether the user is a guest (not authenticated). | yii\web\User |
getReturnUrl() | Returns the URL that the browser should be redirected to after successful login. | yii\web\User |
hasEventHandlers() | Returns a value indicating whether there is any handler attached to the named event. | yii\base\Component |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\Component |
hasProperty() | Returns a value indicating whether a property is defined for this component. | yii\base\Component |
init() | Initializes the application component. | lispa\amos\core\user\AmosUser |
login() | Logs in a user. | yii\web\User |
loginByAccessToken() | Logs in a user by the given access token. | yii\web\User |
loginRequired() | Redirects the user browser to the login page. | yii\web\User |
logout() | Logs out the current user. | yii\web\User |
off() | Detaches an existing event handler from this component. | yii\base\Component |
on() | Attaches an event handler to an event. | yii\base\Component |
setIdentity() | Sets the user identity object. | yii\web\User |
setReturnUrl() | Remembers the URL in the session so that it can be retrieved back later by getReturnUrl(). | yii\web\User |
switchIdentity() | Switches to a new identity for the current user. | yii\web\User |
timeStampLogin() | lispa\amos\core\user\AmosUser | |
timeStampLogout() | lispa\amos\core\user\AmosUser | |
trigger() | Triggers an event. | yii\base\Component |
Protected Methods
Method | Description | Defined By |
---|---|---|
afterLogin() | This method is called after the user is successfully logged in. | yii\web\User |
afterLogout() | This method is invoked right after a user is logged out via logout(). | yii\web\User |
beforeLogin() | This method is called before logging in a user. | yii\web\User |
beforeLogout() | This method is invoked when calling logout() to log out a user. | yii\web\User |
checkRedirectAcceptable() | Checks if the Accept header contains a content type that allows redirection to the login page. |
yii\web\User |
getAccessChecker() | Returns the access checker used for checking access. | yii\web\User |
getAuthManager() | Returns auth manager associated with the user component. | yii\web\User |
getIdentityAndDurationFromCookie() | Determines if an identity cookie has a valid format and contains a valid auth key. | yii\web\User |
loginByCookie() | Logs in a user by cookie. | yii\web\User |
removeIdentityCookie() | Removes the identity cookie. | yii\web\User |
renewAuthStatus() | Updates the authentication status using the information from session and cookie. | yii\web\User |
renewIdentityCookie() | Renews the identity cookie. | yii\web\User |
sendIdentityCookie() | Sends an identity cookie. | yii\web\User |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
EVENT_AFTER_LOGIN | 'afterLogin' | yii\web\User | |
EVENT_AFTER_LOGOUT | 'afterLogout' | yii\web\User | |
EVENT_BEFORE_LOGIN | 'beforeLogin' | yii\web\User | |
EVENT_BEFORE_LOGOUT | 'beforeLogout' | yii\web\User |
Property Details
Method Details
public void can ( $permissionName, $params = [], $allowCaching = true ) | ||
$permissionName | ||
$params | ||
$allowCaching |
Initializes the application component.
public void init ( ) |
public void timeStampLogin ( $event ) | ||
$event | yii\base\Event |
public void timeStampLogout ( $event ) | ||
$event | yii\base\Event |