Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners

Firebird PHP Generator online Help

Prev Return to chapter overview Next

OnAfterLogin

This event occurs after a user is successfully logged in into the application.

 

Signature:

function OnAfterLogin ($userName, $connection, $canLogin, $errorMessage)

 

Parameters:

$userName

The name of the logged user.

$connection

An instance of the EngConnection class.

$canLogin

Specifies whether a user can login (true by default). You can set the value of this parameter to false to disable login even for a user who provided valid credentials.

$errorMessage

A message to be displayed when valid credentials are provided, but $canLogin == false.

 

Example

Among other things this event can be used for tracking the user activity. The code snippet below inserts a new record containing user name and the login time into the 'log' table.

 

$connection->ExecSQL("INSERT INTO log(user_name, log_date) 

  VALUES ('$userName', CURRENT_TIMESTAMP)");

 

See also: OnBeforeLogout event.



Prev Return to chapter overview Next