INFO: Version en.xModule type:

Editing a system event

In the draft view of the processing of an event, you can define the corresponding actions that are to be carried out within the system when this event occurs. For example, logging or other actions (e-mail notification, etc.) can be set up for an event.

There are events at system level, project level and directory level. Events are always processed first at directory level and then at project level. System events generally do not affect any project or directory function and are fired depending on the respective event.

The events at system level are explained below.

Editing an event - draft view
Editing an event - draft view

Operation

Within the 'Draft' tab, you can specify the PHP code that is to be executed as an action for the corresponding event. Enter this without the enclosing PHP tags(<?php ... ?>)!
Various code fragments are already offered by default in the right-hand column.

'Input field':

In this field, enter the PHP code that is to be executed as an action for the corresponding event.

'+ sign for code examples'

:By clicking on the + sign for a predefined code fragment in the right-hand column, the script code of the selected snippet is written to the content window. If source code already exists in the content window, the corresponding code is added at the end.

Overview of possible events

An action can be defined for the corresponding events before or after the respective event occurs, which means that the following events are available to you:

  • onBeforeLogin
  • onAfterLogin
  • onAfterLoginFailed
  • onBeforeLogout
  • onAfterLogout
  • onAfterLockIp
  • onBeforeCreateUser
  • onAfterCreateUser
  • onBeforeEditUser
  • onAfterEditUser
  • onBeforeSetOnlineUser
  • onAfterSetOnlineUser
  • onBeforeSetOfflineUser
  • onAfterSetOfflineUser
  • onBeforeDeleteUser
  • onAfterDeleteUser
  • onAfterInstallUpdate

Depending on the respective event, the following system parameters are available within the actions in the PHP code:

  • For system events
    • $eventData['wEventName']
    • Name of the event (e.g. onAfterEditUser)
    • $eventData['wEventTime']
      Timestamp of the event (date('Y-m-d H:i:s'))
    • $eventData['wEventUser']
      User who triggered the event (e.g. admin)

The purpose of these system parameters is already clear from their names. Instead of these system parameters, you can of course also use PHP framework functions or your own PHP functions.