PHP 클래스 GxcUser, gxc-cms

저자: Tuan Nguyen ([email protected])
상속: extends CWebUser
파일 보기 프로젝트 열기: nganhtuan63/gxc-cms

공개 메소드들

메소드 설명
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 )

메소드 상세

afterLogin() 공개 메소드

Overloads the parent method in order to mark superusers.
public afterLogin ( boolean $fromCookie )
$fromCookie boolean whether the login is based on cookie.

beforeLogin() 공개 메소드

Function to check from Before Login if it is from Cookie
public beforeLogin ( type $id, type $states, type $fromCookie ) : type
$id type
$states type
$fromCookie type
리턴 type

checkAccess() 공개 메소드

Overloads the parent method in order to allow superusers access implicitly.
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.
리턴 boolean whether the operations can be performed by this user.

getIsSuperuser() 공개 메소드

public getIsSuperuser ( ) : boolean
리턴 boolean whether the user is a superuser.

getModel() 공개 메소드

Get the Model from the session of Current User
public getModel ( $attr = '' ) : Object
리턴 Object from Session of Current User

getRightsReturnUrl() 공개 메소드

Returns the URL that the user should be redirected to after updating an authorization item.
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.
리턴 string the URL that the user should be redirected to after updating an authorization item.

getisAdmin() 공개 메소드

access it by Yii::app()->user->isAdmin()
public getisAdmin ( )

login() 공개 메소드

Login Function
public login ( UserIndentity $identity, integer $duration = 3600 )
$identity UserIndentity
$duration integer

logout() 공개 메소드

Logout Function
public logout ( boolean $destroySession = true )
$destroySession boolean destroy the session or not

setIsSuperuser() 공개 메소드

public setIsSuperuser ( boolean $value )
$value boolean whether the user is a superuser.

setRightsReturnUrl() 공개 메소드

public setRightsReturnUrl ( array $value )
$value array return url.