Merge pull request #9398 from hregis/develop_accounting

FIX remove deprecated triggers USER_LOG*
This commit is contained in:
Laurent Destailleur 2018-09-03 11:36:14 +02:00 committed by GitHub
commit 76fdb5e63f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 14 deletions

View File

@ -67,9 +67,9 @@ class Events // extends CommonObject
// List of all Audit/Security events supported by triggers // List of all Audit/Security events supported by triggers
var $eventstolog=array( var $eventstolog=array(
array('id'=>'USER_LOGIN', 'test'=>1), /*array('id'=>'USER_LOGIN', 'test'=>1),
array('id'=>'USER_LOGIN_FAILED', 'test'=>1), array('id'=>'USER_LOGIN_FAILED', 'test'=>1),
array('id'=>'USER_LOGOUT', 'test'=>1), array('id'=>'USER_LOGOUT', 'test'=>1),*/
array('id'=>'USER_CREATE', 'test'=>1), array('id'=>'USER_CREATE', 'test'=>1),
array('id'=>'USER_MODIFY', 'test'=>1), array('id'=>'USER_MODIFY', 'test'=>1),
array('id'=>'USER_NEW_PASSWORD', 'test'=>1), array('id'=>'USER_NEW_PASSWORD', 'test'=>1),

View File

@ -60,7 +60,7 @@ class InterfaceLogevents extends DolibarrTriggers
$date = dol_now(); $date = dol_now();
// Actions // Actions
if ($action == 'USER_LOGIN') /*if ($action == 'USER_LOGIN')
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
@ -87,7 +87,7 @@ class InterfaceLogevents extends DolibarrTriggers
// Initialisation donnees (date,duree,texte,desc) // Initialisation donnees (date,duree,texte,desc)
$text="(UserLogoff,".$object->login.")"; $text="(UserLogoff,".$object->login.")";
$desc="(UserLogoff,".$object->login.")"; $desc="(UserLogoff,".$object->login.")";
} }*/
if ($action == 'USER_CREATE') if ($action == 'USER_CREATE')
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

View File

@ -736,7 +736,7 @@ if (! defined('NOLOGIN'))
{ {
$db->rollback(); $db->rollback();
session_destroy(); session_destroy();
dol_print_error($db,'Error in some hooks afterLogin (or old trigger USER_LOGIN)'); dol_print_error($db,'Error in some hooks afterLogin');
exit; exit;
} }
else else

View File

@ -113,11 +113,6 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'USER_SETINGROUP': //case 'USER_SETINGROUP':
//case 'USER_REMOVEFROMGROUP': //case 'USER_REMOVEFROMGROUP':
//case 'USER_LOGIN':
//case 'USER_LOGIN_FAILED':
//case 'USER_LOGOUT':
//case 'USER_UPDATE_SESSION': // Warning: To increase performances, this action is triggered only if constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
// Actions // Actions
//case 'ACTION_MODIFY': //case 'ACTION_MODIFY':
//case 'ACTION_CREATE': //case 'ACTION_CREATE':

View File

@ -42,10 +42,11 @@ if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuse
global $conf, $langs, $user; global $conf, $langs, $user;
// Appel des triggers // Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; // TODO @deprecated Remove this. Hook must be used, not this trigger.
$interface=new Interfaces($db); //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf); //$interface=new Interfaces($db);
if ($result < 0) { $error++; } //$result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf);
//if ($result < 0) { $error++; }
// Fin appel triggers // Fin appel triggers
// Hooks on logout // Hooks on logout