1
0

debuggage

This commit is contained in:
Daniel Tartavel 2019-11-30 00:55:06 +01:00
parent 3196bc492a
commit e1aeddc0ca

View File

@ -36,6 +36,7 @@ $doldb->query("SELECT login, firstname, lastname, pass_crypted, fk_adherent_type
while ($user = $doldb->result->fetch_assoc())
{
//$flag+=1;
$insert = false;
if ($user["fk_user_valid"] == null) $user["fk_user_valid"] = 0;
$ncdb->query("SELECT uid FROM oc_accounts WHERE uid='" . $user["login"] . "'");
echo "login:" . ($user["login"]) . EOL;
@ -51,11 +52,19 @@ while ($user = $doldb->result->fetch_assoc())
$status = $r["configvalue"] ;
}else
{
$insert = true;
$status = 1;
}
if ( $user["fk_user_valid"] != $status )
{
$query = "UPDATE oc_preferences SET configvalue = '" . $user["fk_user_valid"] ."' WHERE userid='" . $user["login"] . "' AND appid='core' AND configkey='enabled'" ;
if ( $insert )
{
$query = "INSERT INTO oc_preferences (configvalue) VALUES ( '" . $user["fk_user_valid"] . "' ) ";
}else
{
$query = "UPDATE oc_preferences SET configvalue = '" . $user["fk_user_valid"] ."' WHERE userid='" . $user["login"] . "' AND appid='core' AND configkey='enabled'" ;
}
$ncdb->query( $query );
echo $query;
}
@ -75,7 +84,7 @@ while ($user = $doldb->result->fetch_assoc())
$data["address"]["value"] = (concat ($address, utf8_encode($user["town"])));
$data["email"]["value"] = $user["email"];
print_r($data);
if (($account_data = json_encode($data)) == false )
if ( ($account_data = json_encode($data)) == false )
{
echo json_last_error();
exit (0);