Verified Commit 280924b9 authored by Guinness's avatar Guinness

Envoi de mail et mise à jour des cumuls

parent 86d5a82b
......@@ -161,7 +161,7 @@ class Bank extends Controller
$f3->get('container')['command_handler']->handle(new UserUpdateTotalCommand($user['id'], (int) $user['total'] + $don['somme']));
$f3->get('container')['command_handler']->handle(new UserUpdateCumulCommand($user['id'], (int) $user['cumul'] + $don['somme']));
}
$result = $db->query("SELECT cumul FROM users WHERE id='".$don['user_id']."'");
$result = $db->query("SELECT cumul FROM users WHERE id='".$user['id']."'");
$cumul = $result->fetch(\PDO::FETCH_ASSOC);
$cumul = $cumul['cumul'];
$cb_log->write("Nouveau cumul: ".$cumul);
......@@ -202,12 +202,7 @@ Toute l'équipe de La Quadrature du Net
")."\n\n";
// Création de l'url d'administration
$admin_url = "https://don.laquadrature.net/perso";
foreach ($f3->get('languages') as $key => $language) {
if ($lang==$language[1]) {
$admin_url = "https://".$language[0].$f3->get('dev').".laquadrature.net/perso";
}
}
$admin_url = "https://".$f3->get('dev').".laquadrature.net/perso";
// Remplacement des variables par leurs valeurs
$fields = array(
......
......@@ -130,7 +130,10 @@ class Campaign extends Controller
$f3->error("403");
}
$user_id = $db->lastInsertId();
$user = $f3->get('container')['user_finder']->findByEmail(\Utils::asl($email));
$user_id = $user['id'];
$user_log = new \Log('user.log');
$user_log->write("ID ". $user_id. "\n");
}
}
$sql = "INSERT INTO dons SET
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment