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
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_LOGOUT', 'test'=>1),
array('id'=>'USER_LOGOUT', 'test'=>1),*/
array('id'=>'USER_CREATE', 'test'=>1),
array('id'=>'USER_MODIFY', 'test'=>1),
array('id'=>'USER_NEW_PASSWORD', 'test'=>1),

View File

@ -60,7 +60,7 @@ class InterfaceLogevents extends DolibarrTriggers
$date = dol_now();
// Actions
if ($action == 'USER_LOGIN')
/*if ($action == 'USER_LOGIN')
{
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)
$text="(UserLogoff,".$object->login.")";
$desc="(UserLogoff,".$object->login.")";
}
}*/
if ($action == 'USER_CREATE')
{
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();
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;
}
else

View File

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