FIX remove deprecated triggers USER_LOG*

This commit is contained in:
Regis Houssin 2018-09-03 09:30:36 +02:00
parent d2afffaeca
commit 912c05774b
4 changed files with 10 additions and 9 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

@ -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