class InterfaceLogevents extends DolibarrTriggers (View source)

Class of triggers for security audit events

Constants

deprecated VERSION_DEVELOPMENT

deprecated VERSION_EXPERIMENTAL

deprecated VERSION_DOLIBARR

VERSIONS

EVENT_ACTION_DICT

Properties

protected DoliDB $db

Database handler

from  DolibarrTriggers
mixed|string $name

Name of the trigger

from  DolibarrTriggers
string $description

Description of the trigger

from  DolibarrTriggers
""|"development"|"dolibarr"|"experimental" $version

Version of the trigger

from  DolibarrTriggers
string $picto

Image of the trigger

from  DolibarrTriggers
string $family

Category of the trigger

from  DolibarrTriggers
$error

Error reported by the trigger

from  DolibarrTriggers
string[] $errors

Errors reported by the trigger

from  DolibarrTriggers
string[] $warnings

Warnings reported by the trigger

from  DolibarrTriggers

Methods

__construct(DoliDB $db)

Constructor

string
getName()

Returns the name of the trigger file

string
getDesc()

Returns the description of trigger file

string
getVersion()

Returns the version of the trigger file

void
setErrorsFromObject(CommonObject|BlockedLog $object)

setErrorsFromObject

runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)

Function called when a Dolibarr security audit event is done.

static bool
isEventActionTextKey(string $event_text)

Check if text contains an event action key. Used for dynamic localization on frontend events list.

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db

Database handler

string getName()

Returns the name of the trigger file

Return Value

string

string getDesc()

Returns the description of trigger file

Return Value

string

string getVersion()

Returns the version of the trigger file

Return Value

string

Version of trigger file

void setErrorsFromObject(CommonObject|BlockedLog $object)

setErrorsFromObject

Parameters

CommonObject|BlockedLog $object Object

Return Value

void

runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)

Function called when a Dolibarr security audit event is done.

All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)

Parameters

string $action

Event action code @param CommonObject $object CommonObject @param User $user Object user @param Translate $langs Object langs @param Conf $conf Object conf @return int if KO: <0 || if no trigger ran: 0 || if OK: >0

$object
User $user
Translate $langs
Conf $conf

Exceptions

Exception

static bool isEventActionTextKey(string $event_text)

Check if text contains an event action key. Used for dynamic localization on frontend events list.

Parameters

string $event_text

Input event text

Return Value

bool

True if event text is a coded structured string