debuggage
This commit is contained in:
parent
96c945bfc4
commit
b7b89160ef
@ -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 );
|
||||
|
Reference in New Issue
Block a user