1
0
This commit is contained in:
Daniel Tartavel 2019-09-01 00:57:33 +02:00
parent 08978f1976
commit 118086dabe

View File

@ -14,10 +14,9 @@ function esp( $s )
} }
$doldb = new db("dolibarr"); $doldb = new db("dolibarr");
//$doldb->database = ;
$ncdb = new db("nextcloud"); $ncdb = new db("nextcloud");
//$ncdb->database = "nextcloud";
$doldb->query("SELECT login, firstname, lastname, pass_crypted, fk_adherent_type, address, email, phone_perso, phone_mobile, zip, town FROM llx_adherent"); $doldb->query("SELECT login, firstname, lastname, pass_crypted, fk_adherent_type, address, email, phone_perso, phone_mobile, zip, town FROM llx_adherent");
print_r ($ncdb);
while ($user = $doldb->result->fetch_assoc()) while ($user = $doldb->result->fetch_assoc())
{ {
$ncdb->query("SELECT uid FROM oc_accounts WHERE uid='" . $user["login"] . "'"); $ncdb->query("SELECT uid FROM oc_accounts WHERE uid='" . $user["login"] . "'");
@ -49,7 +48,9 @@ while ($user = $doldb->result->fetch_assoc())
} }
$oc_group_user_query = "INSERT INTO oc_group_user(uid, gid) VALUES ('" . $user["login"] . "','" . $gid . "')"; $oc_group_user_query = "INSERT INTO oc_group_user(uid, gid) VALUES ('" . $user["login"] . "','" . $gid . "')";
echo $account_data . EOL . $oc_account_query . EOL . $oc_users_query .EOL . $oc_group_user_query . EOL; echo $account_data . EOL . $oc_account_query . EOL . $oc_users_query .EOL . $oc_group_user_query . EOL;
if (!$ncdb->query($oc_account_query)) if (!$ncdb->query($oc_account_query))
{ {
echo "Echec lors de la requete : (" . $ncdb->errno . ") " . $ncdb->error; echo "Echec lors de la requete : (" . $ncdb->errno . ") " . $ncdb->error;