Skip to content
Extraits de code Groupes Projets

Preprod

Fusionnées Guinness requested to merge Guinness/don:preprod into preprod
Affichage du commit cd2461a7
Suivant
Afficher la dernière version
3 fichiers
+ 25
2
Comparer les modifications
  • Côte à côte
  • En ligne
Fichiers
3
@@ -4,6 +4,7 @@ namespace Controller;
use LQDN\Command\UserUpdateTotalCommand;
use LQDN\Command\UserCreateCommand;
use LQDN\Command\DonationCreateCommand;
use LQDN\Exception\InvalidEmailException;
class Campaign extends Controller
{
@@ -122,8 +123,13 @@ class Campaign extends Controller
$cumul_id = $user['cumul'];
} else {
// The user does not exist, so let's create it
$result = $db->query("INSERT INTO users (pseudo, email, hash)
VALUES ('".$f3->get('pseudo')."', '$email', '$hash')");
try {
$f3->get('container')['command_handler']->handle(new UserCreateCommand($email, $hash, $f3->get('pseudo'), 0, 0));
} catch (InvalidEmailException $e) {
$f3->set("error", _("Email Invalide"));
$f3->error("403");
}
$user_id = $db->lastInsertId();
}
}
Chargement en cours