<< Click to Display Table of Contents >> Navigation: »No topics above this level« Authentication |
Create TWebUISysServer descendant and override the following protected function
function CheckUser(const ALogin, APassword: string; Session: TWebUISession; out Error: string): boolean; virtual;
On success authentication function should return true and set Session.UserID and Session.RoleID fields. In other case it should return false and fill Error parameter.
Note that RoleID = 1 is reserved for Administrator. RoleID should be present in UI_ROLES table.
To change design of login page, modify .web/Login.hsv file.
TWebUIServer.Sessons has the following properties that can be modified:
SessionLiveSec - session timeout after last request. After this period user will be logged off.
MaxSessions - maximum allower number of simultaneous sessions.
And following read only properties
AuthorizedUsers - current number of authorized users
AuthorizedMax - nax number of authorized users
MaxCount - maximum number of sessions
To check is session exists use
function HasSession(const SessionID: string): boolean;
Session has the following properties
ID - unique session ID
IPPort - IP adres and port
Host - host name
UserLogin - login
UserAgent - agent name
UserName - name (optional)
RoleName - role name
Lang - user language
UserID - user ID
RoleID - role ID
Port - port number
Requests - number of processed requests
Started - sesson start time
Last - time of last request
Authorized - is session authorized
LastURL - last requested URL
To logout session call Session.Close.
Session has Params: TString property to store custom parameters.