debug
This commit is contained in:
parent
82e5f73023
commit
0c5267f972
|
@ -99,7 +99,7 @@ class InterfaceOutilsLalisTriggers extends DolibarrTriggers
|
|||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
if (empty($conf->outilslalis->enabled)) return 0; // Module not active, we do nothing
|
||||
|
||||
|
||||
// Put here code you want to execute when a Dolibarr business events occurs.
|
||||
// Data and type of action are stored into $object and $action
|
||||
switch ($action) {
|
||||
|
@ -135,25 +135,26 @@ class InterfaceOutilsLalisTriggers extends DolibarrTriggers
|
|||
|
||||
// Members
|
||||
case 'MEMBER_CREATE':
|
||||
include "nouveau_membre.php";
|
||||
sync2contacts($user, $object);
|
||||
sync2nextcloud(INSERT, $user, $object);
|
||||
include "nouveau_membre.php";
|
||||
sync2contacts($user, $object);
|
||||
sync2nextcloud(INSERT, $user, $object);
|
||||
|
||||
break;
|
||||
//case 'MEMBER_VALIDATE':
|
||||
//break;
|
||||
//case 'MEMBER_SUBSCRIPTION':
|
||||
case 'MEMBER_MODIFY':
|
||||
include "nouveau_membre.php";
|
||||
sync2contacts($user, $object);
|
||||
sync2nextcloud(UPDATE, $user, $object);
|
||||
include "nouveau_membre.php";
|
||||
sync2contacts($user, $object);
|
||||
sync2nextcloud(UPDATE, $user, $object);
|
||||
|
||||
break;
|
||||
//case 'MEMBER_NEW_PASSWORD':
|
||||
//case 'MEMBER_RESILIATE':
|
||||
//break;
|
||||
include "nouveau_membre.php";
|
||||
|
||||
case 'MEMBER_DELETE':
|
||||
include "nouveau_membre.php";
|
||||
delete_contact($object);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -11,7 +11,7 @@ function log_write($log, $level=INFO)
|
|||
global $table_prefix, $webmaster, $headers;
|
||||
require_once( "db.class.php" );
|
||||
require( "entete_mail.php" );
|
||||
|
||||
|
||||
$user = ( !empty( $_SERVER["PHP_AUTH_USER"])?$_SERVER["PHP_AUTH_USER"]:'' );
|
||||
$log_mail = str_replace ( "<br />", "\n", $log ) . "\n";
|
||||
$log_mail .= ( !empty( $_SERVER["REQUEST_METHOD"])?'$_SERVER["REQUEST_METHOD"]' . $_SERVER["REQUEST_METHOD"] . "\n":'' );
|
||||
|
@ -25,9 +25,9 @@ function log_write($log, $level=INFO)
|
|||
$log_mail .= "Utilisateur: $user \n";
|
||||
$log_mail .= ( !empty( $_SERVER["ORIG_PATH_INFO"])?'$_SERVER["ORIG_PATH_INFO"]' . $_SERVER["ORIG_PATH_INFO"] . "\n":'' );
|
||||
$log_mail .= ( !empty( $_SERVER["PATH_INFO"])?'$_SERVER["PATH_INFO"]' . $_SERVER["PATH_INFO"] . "\n":'' );
|
||||
$db1 = new db('lalis');
|
||||
$db1->open();
|
||||
if( !empty( $db1->connect ) )
|
||||
/*$db1 = new db('lalis');
|
||||
//$db1->open();
|
||||
/if( !empty( $db1->connect ) )
|
||||
{
|
||||
$query = 'INSERT INTO ' . $table_prefix . 'logs SET date=NOW(), auteur="' . $db1->protect( $user ) . '", log="' . $db1->protect($log) . '", niveau="' . $level . '"';
|
||||
$db1->query( $query );
|
||||
|
@ -41,7 +41,8 @@ function log_write($log, $level=INFO)
|
|||
{
|
||||
echo $db1->error();
|
||||
mail( $webmaster, "Erreur écriture logs => " . __file__ . " ligne " . __line__ , $log_mail, $headers );
|
||||
}
|
||||
}*/
|
||||
dol_syslog($log . " , niveau:" . $level);
|
||||
if ( $level == ALERT )
|
||||
{
|
||||
mail( $webmaster, "Alerte Site Web", $log_mail, $headers );
|
||||
|
|
Reference in New Issue