Class TDbUserManager
TDbUserManager class
TDbUserManager manages user accounts that are stored in a database.
TDbUserManager is mainly designed to be used together with 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:
<module id="db" class="System.Data.TDataSourceConfig" ..../> <module id="users" class="System.Security.TDbUserManager" UserClass="Path.To.MyUserClass" ConnectionID="db" /> <module id="auth" class="System.Security.TAuthManager" UserManager="users" LoginPage="Path.To.LoginPage" />
In the above, setUserClass UserClass specifies what class will be
used to create user instance. The class must extend from TDbUser
. setConnectionID ConnectionID refers to the ID of a TDataSourceConfig
module which specifies how to establish database connection to retrieve user
information.
- TComponent
-
TApplicationComponent
-
TModule implements IModule
-
TDbUserManager implements IUserManager
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.1.0
Located at Security/TDbUserManager.php
public
|
#
init(
Initializes the module. This method is required by IModule and is invoked by application. |
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
boolean
|
#
validateUser( string $username, string $password )
Validates if the username and password are correct. |
public
|
|
public
string
|
|
public
|
#
setConnectionID( string $value )
Sets the ID of a TDataSourceConfig module. The datasource module will be used to establish the DB connection that will be used by the user manager. |
public
|
|
protected
|
|
public
|
#
getUserFromCookie(
Returns a user instance according to auth data stored in a cookie. |
public
|
getID(),
setID()
|
getApplication(),
getRequest(),
getResponse(),
getService(),
getSession(),
publishAsset(),
publishFilePath()
|
GLOBAL_RAISE_EVENT_LISTENER
|