CWebUser
Name | user |
---|---|
Class | CWebUser |
Location | /home/vhosts/app-manager.eu5.org/framework/web/auth/CWebUser.php |
CWebUser represents the persistent state for a Web application user.
CWebUser is used as an application component whose ID is 'user'. Therefore, at any place one can access the user state via
CWebUser is used as an application component whose ID is 'user'. Therefore, at any place one can access the user state via
Yii::app()->user
.
CWebUser should be used together with an {@link IUserIdentity identity}
which implements the actual authentication algorithm.
A typical authentication process using CWebUser is as follows:
- The user provides information needed for authentication.
- An {@link IUserIdentity identity instance} is created with the user-provided information.
- Call {@link IUserIdentity::authenticate} to check if the identity is valid.
- If valid, call {@link CWebUser::login} to login the user, and Redirect the user browser to {@link returnUrl}.
- If not valid, retrieve the error code or message from the identity instance and display it.
Options
Displaying 11-13 of 13 results.
Name | Value | Description | Type |
---|---|---|---|
name | null | Sets the unique identifier for the user (e.g. username). the user name. @see getName | string |
returnUrl | null | The URL that the user should be redirected to after login. | string |
stateKeyPrefix | null | A prefix for the name of the session variables storing user session data. | string |
Go to page: