Method | Description | |
---|---|---|
afterLogin ( boolean $fromCookie ) | Actions to be taken after logging in. | |
beforeLogin ( type $id, type $states, type $fromCookie ) : type | Function to check from Before Login if it is from Cookie | |
checkAccess ( string $operation, array $params = [], boolean $allowCaching = true ) : boolean | Performs access check for this user. | |
getIsSuperuser ( ) : boolean | ||
getModel ( $attr = '' ) : Object | Get the Model from the session of Current User | |
getRightsReturnUrl ( string $defaultUrl = null ) : string | Returns the URL that the user should be redirected to after updating an authorization item. | |
getisAdmin ( ) | This is a function that checks the field 'role' in the User model to be equal to 1, that means it's admin | |
login ( UserIndentity $identity, integer $duration = 3600 ) | Login Function | |
logout ( boolean $destroySession = true ) | Logout Function | |
setIsSuperuser ( boolean $value ) | ||
setRightsReturnUrl ( array $value ) |
public afterLogin ( boolean $fromCookie ) | ||
$fromCookie | boolean | whether the login is based on cookie. |
public beforeLogin ( type $id, type $states, type $fromCookie ) : type | ||
$id | type | |
$states | type | |
$fromCookie | type | |
return | type |
public checkAccess ( string $operation, array $params = [], boolean $allowCaching = true ) : boolean | ||
$operation | string | the name of the operation that need access check. |
$params | array | name-value pairs that would be passed to business rules associated with the tasks and roles assigned to the user. |
$allowCaching | boolean | whether to allow caching the result of access checki. This parameter has been available since version 1.0.5. When this parameter is true (default), if the access check of an operation was performed before, its result will be directly returned when calling this method to check the same operation. If this parameter is false, this method will always call {@link CAuthManager::checkAccess} to obtain the up-to-date access result. Note that this caching is effective only within the same request. |
return | boolean | whether the operations can be performed by this user. |
public getIsSuperuser ( ) : boolean | ||
return | boolean | whether the user is a superuser. |
public getModel ( $attr = '' ) : Object | ||
return | Object | from Session of Current User |
public getRightsReturnUrl ( string $defaultUrl = null ) : string | ||
$defaultUrl | string | the default return URL in case it was not set previously. If this is null, the application entry URL will be considered as the default return URL. |
return | string | the URL that the user should be redirected to after updating an authorization item. |
public setIsSuperuser ( boolean $value ) | ||
$value | boolean | whether the user is a superuser. |
public setRightsReturnUrl ( array $value ) | ||
$value | array | return url. |