PHP 클래스 Prado\Security\TDbUserManager

TDbUserManager manages user accounts that are stored in a database. TDbUserManager is mainly designed to be used together with {@link TAuthManager} which manages how users are authenticated and authorized in a Prado application. To use TDbUserManager together with TAuthManager, configure them in the application configuration like following: In the above, {@link setUserClass UserClass} specifies what class will be used to create user instance. The class must extend from {@link TDbUser}. {@link setConnectionID ConnectionID} refers to the ID of a {@link TDataSourceConfig} module which specifies how to establish database connection to retrieve user information.
부터: 3.1.0
저자: Qiang Xue ([email protected])
상속: extends Prado\TModule, implements IUserManager
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
getConnectionID ( ) : string
getDbConnection ( ) : TDbConnection
getGuestName ( ) : string
getUser ( $username = null ) : TUser Returns a user instance given the user name.
getUserClass ( ) : string
getUserFromCookie ( $cookie ) : TDbUser Returns a user instance according to auth data stored in a cookie.
init ( $config ) Initializes the module.
saveUserToCookie ( $cookie ) Saves user auth data into a cookie.
setConnectionID ( $value ) Sets the ID of a TDataSourceConfig module.
setGuestName ( $value )
setUserClass ( $value )
validateUser ( $username, $password ) : boolean Validates if the username and password are correct.

보호된 메소드들

메소드 설명
createDbConnection ( $connectionID ) : TDbConnection Creates the DB connection.

메소드 상세

createDbConnection() 보호된 메소드

Creates the DB connection.
protected createDbConnection ( $connectionID ) : TDbConnection
리턴 TDbConnection the created DB connection

getConnectionID() 공개 메소드

public getConnectionID ( ) : string
리턴 string the ID of a TDataSourceConfig module. Defaults to empty string, meaning not set.

getDbConnection() 공개 메소드

public getDbConnection ( ) : TDbConnection
리턴 TDbConnection the database connection that may be used to retrieve user data.

getGuestName() 공개 메소드

public getGuestName ( ) : string
리턴 string guest name, defaults to 'Guest'

getUser() 공개 메소드

Returns a user instance given the user name.
public getUser ( $username = null ) : TUser
리턴 TUser the user instance, null if the specified username is not in the user database.

getUserClass() 공개 메소드

public getUserClass ( ) : string
리턴 string the user class name in namespace format. Defaults to empty string, meaning not set.

getUserFromCookie() 공개 메소드

Returns a user instance according to auth data stored in a cookie.
부터: 3.1.1
public getUserFromCookie ( $cookie ) : TDbUser
리턴 TDbUser the user instance generated based on the cookie auth data, null if the cookie does not have valid auth data.

init() 공개 메소드

This method is required by IModule and is invoked by application.
public init ( $config )

saveUserToCookie() 공개 메소드

Saves user auth data into a cookie.
부터: 3.1.1
public saveUserToCookie ( $cookie )

setConnectionID() 공개 메소드

The datasource module will be used to establish the DB connection that will be used by the user manager.
public setConnectionID ( $value )

setGuestName() 공개 메소드

public setGuestName ( $value )

setUserClass() 공개 메소드

public setUserClass ( $value )

validateUser() 공개 메소드

Validates if the username and password are correct.
public validateUser ( $username, $password ) : boolean
리턴 boolean true if validation is successful, false otherwise.