From b7b89160efd49e5f2a88fb8095c37787a601489a Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Sun, 1 Dec 2019 11:16:26 +0100 Subject: [PATCH] debuggage --- nconnector.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nconnector.php b/nconnector.php index f7ee10c..b229ebd 100755 --- a/nconnector.php +++ b/nconnector.php @@ -55,9 +55,9 @@ while ($user = $doldb->result->fetch_assoc()) { // pas de définition de la validité de l'utilisateur => par défaut utilisateur valide $insert = true; // insertion de la validité dans la table préférence - $status = 1; + $status = 'true'; } - if ( $user["fk_user_valid"] != $status ) + if ( ($user["fk_user_valid"]==0?"false":"true") != $status ) { // différence entre nexcloud et dolibarr // echo "\ndifférent\n##############################\n" . $user['fk_user_valid'] . "!=" . $status . "\n"; @@ -73,11 +73,11 @@ while ($user = $doldb->result->fetch_assoc()) print_r($datefin); if ( $datefin->getTimestamp() <= time() ) { - write_status( $insert, $user['login'] , 0, $ncdb ); + write_status( $insert, $user['login'] , "false", $ncdb ); }elseif ( $status == 0 ) { // ré active l'utlisateur désactivé à jour de cotisation. - write_status( $insert, $user['login'] , 1, $ncdb ); + write_status( $insert, $user['login'] , "true", $ncdb ); } } }else @@ -148,10 +148,10 @@ function write_status( $insert, $uid, $status, $db ) { if ( $insert ) { - $query = "INSERT INTO oc_preferences (userid, appid, configkey, configvalue) VALUES ( '" . $uid . "', 'core', 'enabled', '" . ($status==1?"true":"false") . "' ) "; + $query = "INSERT INTO oc_preferences (userid, appid, configkey, configvalue) VALUES ( '" . $uid . "', 'core', 'enabled', '" . $status . "' ) "; }else { - $query = "UPDATE oc_preferences SET configvalue = '" . ($status==1?"true":"false") ."' WHERE userid='" . $uid . "' AND appid='core' AND configkey='enabled'" ; + $query = "UPDATE oc_preferences SET configvalue = '" . $status ."' WHERE userid='" . $uid . "' AND appid='core' AND configkey='enabled'" ; } $db->query( $query );