Commit 268748c6 authored by okhin's avatar okhin 🚴

Merge branch 'preprod' into 'master'

Modification front

See merge request lqdn-interne/don!54
parents 6f5fff2e 151faf24
...@@ -15,6 +15,10 @@ class Admin extends Controller ...@@ -15,6 +15,10 @@ class Admin extends Controller
public function beforeRoute($f3, $args) public function beforeRoute($f3, $args)
{ {
parent::beforeRoute($f3, $args); parent::beforeRoute($f3, $args);
// Template de base par défaut
$this->template = "backend/base.html";
// URL de base à utiliser sur le site // URL de base à utiliser sur le site
$f3->set('DONS_STATUTS', array( $f3->set('DONS_STATUTS', array(
0 => "Ponctuel non validé", 0 => "Ponctuel non validé",
...@@ -41,19 +45,6 @@ class Admin extends Controller ...@@ -41,19 +45,6 @@ class Admin extends Controller
100 => "non applicable", 100 => "non applicable",
)); ));
$f3->set('TAILLES', array(
1 => _('Coupe Homme, Taille') . ' S',
2 => _('Coupe Homme, Taille') . ' M',
3 => _('Coupe Homme, Taille') . ' L',
4 => _('Coupe Homme, Taille') . ' XL',
5 => _('Coupe Femme, Taille') . ' S',
6 => _('Coupe Femme, Taille') . ' M',
7 => _('Coupe Femme, Taille') . ' L',
8 => _('Coupe Femme, Taille') . ' XL',
9 => _('Coupe Homme, Taille') . ' XXL',
10 => _('Coupe Femme, Taille') . ' XXL',
));
if (!$f3->get('SESSION.admin')) { if (!$f3->get('SESSION.admin')) {
$mapper = new\DB\SQL\Mapper($f3->get('DB'), 'admins'); $mapper = new\DB\SQL\Mapper($f3->get('DB'), 'admins');
$auth = new \Auth($mapper, array('id'=>'user_id', 'pw'=>'password')); $auth = new \Auth($mapper, array('id'=>'user_id', 'pw'=>'password'));
...@@ -109,6 +100,102 @@ class Admin extends Controller ...@@ -109,6 +100,102 @@ class Admin extends Controller
$f3->set('block_content', 'backend/dons.html'); $f3->set('block_content', 'backend/dons.html');
} }
public function validate($f3, $args)
{
$id = '';
$error = '';
$db = $f3->get('DB');
if ($f3->get('VERB')=='GET') {
if ($f3->exists('PARAMS.id')) {
$id = $f3->get('PARAMS.id');
} else {
$error= 'Pas d\'id associé à ce don';
}
if ($id != '') {
$result = $db->query("SELECT status,
somme,
adresse_id,
user_id
FROM dons
WHERE id = ".\Utils::asl($id));
$result = $result->fetch(\PDO::FETCH_ASSOC);
$user_amount = $db->query("SELECT total, cumul FROM users
WHERE id = ".\Utils::asl($result['user_id']));
$user_amount = $user_amount->fetch(\PDO::FETCH_ASSOC);
}
if ($result['status'] >= 100) {
$status = 101;
} else {
$status = 1;
}
$total = $user_amount['total'] + $result['somme'];
$cumul = $user_amount['total'] + $result['somme'];
}
if ($error != '') {
} else {
$db->query(
"UPDATE dons
SET status = $status
WHERE id = ".\Utils::asl($id)
);
$db->query("UPDATE users
SET total = $total,
cumul = $cumul
WHERE id = ".\Utils::asl($result['user_id']));
}
$f3->reroute("/admin/users/".$result['user_id']);
}
public function invalidate($f3, $args)
{
$id = '';
$error = '';
$db = $f3->get('DB');
if ($f3->get('VERB')=='GET') {
if ($f3->exists('PARAMS.id')) {
$id = $f3->get('PARAMS.id');
} else {
$error= 'Pas d\'id associé à ce don';
}
if ($id != '') {
$result = $db->query("SELECT status,
somme,
adresse_id,
user_id
FROM dons
WHERE id = ".\Utils::asl($id));
$result = $result->fetch(\PDO::FETCH_ASSOC);
$user_amount = $db->query("SELECT total, cumul FROM users
WHERE id = ".\Utils::asl($result['user_id']));
$user_amount = $user_amount->fetch(\PDO::FETCH_ASSOC);
}
if ($result['status'] >= 100) {
$status = 100;
} else {
$status = 0;
}
$total = $user_amount['total'] - $result['somme'];
$cumul = $user_amount['total'] - $result['somme'];
if ($cumul < 0) {
$error = "Impossible d'invalider, une contrepartie a été demandée";
}
}
if ($error != '') {
} else {
$db->query(
"UPDATE dons
SET status = $status
WHERE id = ".\Utils::asl($id)
);
$db->query("UPDATE users
SET total = $total,
cumul = $cumul
WHERE id = ".\Utils::asl($result['user_id']));
}
$f3->reroute("/admin/users/".$result['user_id']);
}
public function support($f3, $args) public function support($f3, $args)
{ {
$id = ''; $id = '';
...@@ -126,6 +213,7 @@ class Admin extends Controller ...@@ -126,6 +213,7 @@ class Admin extends Controller
if ($f3->exists('PARAMS.id')) { if ($f3->exists('PARAMS.id')) {
$id = $f3->get('PARAMS.id'); $id = $f3->get('PARAMS.id');
} }
$f3->set('block_content', 'backend/don.html');
} else { } else {
$id = $f3->get('POST.id'); $id = $f3->get('POST.id');
$pseudo = $f3->get('POST.pseudo'); $pseudo = $f3->get('POST.pseudo');
...@@ -184,11 +272,6 @@ class Admin extends Controller ...@@ -184,11 +272,6 @@ class Admin extends Controller
1)"); 1)");
// Récupération de l'id pour passage en mode édition // Récupération de l'id pour passage en mode édition
$id = $db->lastInsertId(); $id = $db->lastInsertId();
if ($adresse_id != '') {
$db->query("UPDATE dons
SET adresse_id = $adresse_id
WHERE id = $id");
}
} else { } else {
// We will get the ids associated to the gift first // We will get the ids associated to the gift first
$result = $db->query("SELECT adresse_id, $result = $db->query("SELECT adresse_id,
...@@ -197,26 +280,6 @@ class Admin extends Controller ...@@ -197,26 +280,6 @@ class Admin extends Controller
WHERE id = ".\Utils::asl($f3->get('POST.id'))); WHERE id = ".\Utils::asl($f3->get('POST.id')));
$result = $result->fetch(\PDO::FETCH_ASSOC); $result = $result->fetch(\PDO::FETCH_ASSOC);
// Let's update the adresse first or create the adress // Let's update the adresse first or create the adress
if ($result['adresse_id'] == '0') {
$db->query("INSERT INTO adresses
(nom, adresse, adresse2, codepostal, ville, pays)
VALUES ('".\Utils::asl($nom)."',
'".\Utils::asl($adresse)."',
'".\Utils::asl($adresse2)."',
'".\Utils::asl($codepostal)."',
'".\Utils::asl($ville)."',
'".\Utils::asl($pays)."')");
$result['adresse_id'] = $db->lastInsertId();
} else {
$db->query("UPDATE adresses
SET nom='".\Utils::asl($nom)."',
adresse='".\Utils::asl($adresse)."',
adresse2='".\Utils::asl($adresse2)."',
codepostal='".\Utils::asl($codepostal)."',
ville='".\Utils::asl($ville)."',
pays='".\Utils::asl($pays)."'
WHERE id={$result['adresse_id']}");
}
$db->query("UPDATE users $db->query("UPDATE users
SET email='".\Utils::asl($email)."', SET email='".\Utils::asl($email)."',
pseudo='".\Utils::asl($pseudo)."' pseudo='".\Utils::asl($pseudo)."'
...@@ -580,17 +643,17 @@ class Admin extends Controller ...@@ -580,17 +643,17 @@ class Admin extends Controller
ville='".\Utils::asl($ville)."', ville='".\Utils::asl($ville)."',
pays='".\Utils::asl($pays)."')"); pays='".\Utils::asl($pays)."')");
$adresse_id = $db->lastInsertId(); $adresse_id = $db->lastInsertId();
} } else {
// Updating the adresses first
// Updating the adresses first $db->query("UPDATE adresses
$db->query("UPDATE adresses SET nom='".\Utils::asl($nom)."',
SET nom='".\Utils::asl($nom)."', adresse='".\Utils::asl($adresse)."',
adresse='".\Utils::asl($adresse)."', adresse2='".\Utils::asl($adresse2)."',
adresse2='".\Utils::asl($adresse2)."', codepostal='".\Utils::asl($codepostal)."',
codepostal='".\Utils::asl($codepostal)."', ville='".\Utils::asl($ville)."',
ville='".\Utils::asl($ville)."', pays='".\Utils::asl($pays)."'
pays='".\Utils::asl($pays)."' WHERE id = $adresse_id");
WHERE id = $adresse_id"); };
$db->query("UPDATE contreparties $db->query("UPDATE contreparties
SET quoi='".\Utils::asl($quoi)."', SET quoi='".\Utils::asl($quoi)."',
taille='".\Utils::asl($taille)."', taille='".\Utils::asl($taille)."',
...@@ -601,27 +664,8 @@ class Admin extends Controller ...@@ -601,27 +664,8 @@ class Admin extends Controller
} }
} }
$contrepartie = array();
if ($id!='') { if ($id!='') {
// Récupération de la contrepartie $contrepartie = $f3->get('container')['counterpart_finder']->findById((int) $id);
$result = $db->query("SELECT c.id AS id,
c.user_id AS user_id,
c.quoi AS quoi,
c.taille AS taille,
c.status AS status,
a.nom AS nom,
a.adresse AS adresse,
a.codepostal AS codepostal,
a.ville AS ville,
a.pays AS pays,
u.commentaire AS commentaire
FROM contreparties c
JOIN users u ON c.user_id = u.id
LEFT JOIN adresses a ON c.adresse_id = a.id
WHERE c.id=".$id);
if ($result->fetch(\PDO::FETCH_ASSOC)) {
$contrepartie = $result->fetch(\PDO::FETCH_ASSOC);
}
} else { } else {
$contrepartie = array( $contrepartie = array(
'id'=>$id, 'id'=>$id,
...@@ -663,6 +707,52 @@ class Admin extends Controller ...@@ -663,6 +707,52 @@ class Admin extends Controller
$f3->set('block_content', 'backend/contrepartie.html'); $f3->set('block_content', 'backend/contrepartie.html');
} }
public function adresse($f3, $args)
{
$id = '';
$form_name = '';
$user_id = '';
$db = $f3->get('DB');
if ($f3->get('VERB') == 'POST') {
$id = \Utils::asl($f3->get('POST.id'));
$form_name = $f3->get('POST.action');
}
if ($form_name == 'delete') {
$result = $db->query("SELECT user_id FROM adresses WHERE id = $id");
$result = $result->fetch(\PDO::FETCH_ASSOC);
$user_id = \Utils::asl($result["user_id"]);
$db->query("UPDATE dons SET adresse_id = NULL
WHERE user_id = $user_id");
$db->query("UPDATE contreparties SET adresse_id = NULL
WHERE user_id = $user_id");
$db->query(
"DELETE FROM adresses
WHERE id = $id"
);
} else {
$result = $db->query("SELECT user_id FROM adresses WHERE id = $id");
$result = $result->fetch(\PDO::FETCH_ASSOC);
$user_id = \Utils::asl($result["user_id"]);
$nom = \Utils::asl($f3->get('POST.nom'));
$adresse = \Utils::asl($f3->get('POST.adresse'));
$adresse2 = \Utils::asl($f3->get('POST.adresse2'));
$codepostal = \Utils::asl($f3->get('POST.codepostal'));
$ville = \Utils::asl($f3->get('POST.ville'));
$pays = \Utils::asl($f3->get('POST.pays'));
$db->query(
"UPDATE adresses SET
nom = '".$nom."',
adresse = '".$adresse."',
adresse2 = '".$adresse2."',
codepostal = '".$codepostal."',
ville = '".$ville."',
pays = '".$pays."'
WHERE id = $id"
);
}
$f3->reroute("/admin/users/$user_id");
}
public function user($f3, $args) public function user($f3, $args)
{ {
$id = array_key_exists('id', $args) ? \Utils::asl($args['id']) : ''; $id = array_key_exists('id', $args) ? \Utils::asl($args['id']) : '';
...@@ -689,7 +779,7 @@ class Admin extends Controller ...@@ -689,7 +779,7 @@ class Admin extends Controller
// Let's get everything we have related to our user // Let's get everything we have related to our user
$user = $f3->get('container')['user_finder']->findById($id); $user = $f3->get('container')['user_finder']->findById($id);
$user['adresses'] = $f3->get('container')['address_finder']->findByUserId($user['id']); $user['adresse'] = $f3->get('container')['address_finder']->findByUserId($user['id']);
$user['dons'] = $f3->get('container')['donation_finder']->findByUserId($user['id']); $user['dons'] = $f3->get('container')['donation_finder']->findByUserId($user['id']);
$user['contreparties'] = $f3->get('container')['counterpart_finder']->findByUserId($user['id']); $user['contreparties'] = $f3->get('container')['counterpart_finder']->findByUserId($user['id']);
......
<?php <?php
namespace Controller; namespace Controller;
use LQDN\Command\UserUpdateCumulCommand;
use LQDN\Command\UserUpdateTotalCommand;
class Bank extends Controller class Bank extends Controller
{ {
/* We want to ignore the sanitizing on this page */ /* We want to ignore the sanitizing on this page */
...@@ -150,13 +153,13 @@ class Bank extends Controller ...@@ -150,13 +153,13 @@ class Bank extends Controller
$status = $res->fetch(\PDO::FETCH_ASSOC); $status = $res->fetch(\PDO::FETCH_ASSOC);
$status = $status['status']; $status = $status['status'];
$res = $db->query("SELECT * FROM users WHERE id='".$don['user_id']."';"); $user = $f3->get('container')['user_finder']->findById($don['user_id']);
$user = $res->fetch(\PDO::FETCH_ASSOC);
$cb_log->write("Utilisation d'un utilisateur existant"); $cb_log->write("Utilisation d'un utilisateur existant");
// Ajout du nouveau don au cumul actuel // Ajout du nouveau don au cumul actuel
if ($status!=101) { if ($status!=101) {
$cb_log->write("Ajout de ".$don['somme']); $cb_log->write("Ajout de ".$don['somme']);
$db->query("UPDATE users set cumul = cumul + " . $don['somme'] . ", total = total + " . $don['somme'] . " WHERE id='".$don['user_id']."'"); $f3->get('container')['command_handler']->handle(new UpdateUserTotalCommand($user['id'], (int) $user['total'] + $don['somme']));
$f3->get('container')['command_handler']->handle(new UpdateUserCumulCommand($user['id'], (int) $user['cumul'] + $don['cumul']));
} }
$result = $db->query("SELECT cumul FROM users WHERE id='".$don['user_id']."'"); $result = $db->query("SELECT cumul FROM users WHERE id='".$don['user_id']."'");
$cumul = $result->fetch(\PDO::FETCH_ASSOC); $cumul = $result->fetch(\PDO::FETCH_ASSOC);
...@@ -199,7 +202,7 @@ Toute l'équipe de La Quadrature du Net ...@@ -199,7 +202,7 @@ Toute l'équipe de La Quadrature du Net
")."\n\n"; ")."\n\n";
// Création de l'url d'administration // Création de l'url d'administration
$admin_url = "https://support.laquadrature.net/perso"; $admin_url = "https://don.laquadrature.net/perso";
foreach ($f3->get('languages') as $key => $language) { foreach ($f3->get('languages') as $key => $language) {
if ($lang==$language[1]) { if ($lang==$language[1]) {
$admin_url = "https://".$language[0].$f3->get('dev').".laquadrature.net/perso"; $admin_url = "https://".$language[0].$f3->get('dev').".laquadrature.net/perso";
......
<?php <?php
namespace Controller; namespace Controller;
use LQDN\Command\UserUpdateTotalCommand;
use LQDN\Command\UserCreateCommand;
use LQDN\Command\DonationCreateCommand;
class Campaign extends Controller class Campaign extends Controller
{ {
/* /*
...@@ -93,8 +97,7 @@ class Campaign extends Controller ...@@ -93,8 +97,7 @@ class Campaign extends Controller
$db = $f3->get('DB'); $db = $f3->get('DB');
// Si l'utilisateur est déjà connecté, on le récupère // Si l'utilisateur est déjà connecté, on le récupère
if ($f3->get('SESSION.user', true)) { if ($f3->get('SESSION.user', true)) {
$user = $db->query("SELECT * FROM users WHERE id = ".$f3->get('SESSION.id')); $user = $f3->get('container')['user_finder']->findById($f3->get('SESSION.id'));
$user = $user->fetch(\PDO::FETCH_ASSOC);
$email = $user['email']; $email = $user['email'];
$user_id = $user['id']; $user_id = $user['id'];
$cumul_id = $user['cumul']; $cumul_id = $user['cumul'];
...@@ -103,10 +106,9 @@ class Campaign extends Controller ...@@ -103,10 +106,9 @@ class Campaign extends Controller
$email = \Utils::asl($f3->get('email')); $email = \Utils::asl($f3->get('email'));
$hash = hash('sha256', $f3->get('password')); $hash = hash('sha256', $f3->get('password'));
$sql = "SELECT id FROM users WHERE email = '".\Utils::asl($email)."';"; $user = $f3->get('container')['user_finder']->findByEmail(\Utils::asl($email));
$result = $db->query($sql);
if ($result->fetchColumn() > 0) { if (len($user) > 0) {
// We have an existing user, we should try to login with the provided password // We have an existing user, we should try to login with the provided password
// or 403. // or 403.
$mapper = new \DB\SQL\Mapper($f3->get('DB'), 'users'); $mapper = new \DB\SQL\Mapper($f3->get('DB'), 'users');
...@@ -114,11 +116,6 @@ class Campaign extends Controller ...@@ -114,11 +116,6 @@ class Campaign extends Controller
$login = $auth->login($email, $hash); $login = $auth->login($email, $hash);
if (!$login) { if (!$login) {
$f3->error(403); $f3->error(403);
} else {
$result = $db->query("SELECT id, cumul FROM users WHERE email = '".\Utils::asl($email)."'");
$user = $result->fetch(\PDO::FETCH_ASSOC);
$user_id = $user['id'];
$cumul_id = $user['cumul'];
} }
} else { } else {
// The user does not exist, so let's create it // The user does not exist, so let's create it
......
...@@ -4,6 +4,11 @@ namespace Controller; ...@@ -4,6 +4,11 @@ namespace Controller;
use LQDN\Command\AddressCreateCommand; use LQDN\Command\AddressCreateCommand;
use LQDN\Command\AddressDeleteCommand; use LQDN\Command\AddressDeleteCommand;
use LQDN\Command\AddressUpdateCommand; use LQDN\Command\AddressUpdateCommand;
use LQDN\Command\CounterpartCreateCommand;
use LQDN\Command\CounterpartDeleteCommand;
use LQDN\Command\UserUpdateCumulCommand;
use LQDN\Command\UserUpdateTotalCommand;
use LQDN\Command\UserCreateCommand;
class Perso extends Controller class Perso extends Controller
{ {
...@@ -38,41 +43,14 @@ class Perso extends Controller ...@@ -38,41 +43,14 @@ class Perso extends Controller
{ {
// Chargement des informations de l'utilisateur // Chargement des informations de l'utilisateur
$db = $f3->get('DB'); $db = $f3->get('DB');
// Let's update the total first $user = $f3->get('container')['user_finder']->findById($f3->get('SESSION.id'));
$total = 0; $f3->set('infos', $user);
$total_res = $db->query("SELECT SUM(somme) as total FROM dons WHERE status in (1, 4, 101, 102) AND user_id='".$f3->get('SESSION.id')."'"); $result = $db->query("SELECT id, pdf, decimale FROM dons WHERE user_id='".$user['id']."' and pdf!='' ");
$total_res = $total_res->fetch(\PDO::FETCH_ASSOC);
$total = $total_res['total'];
// While we're at it, let's remove the price of each asked contreparties
// printed piplome is 30, pibag is 50, pishirt is 100 and hoodie is 250
// We first need to have the number of each counterpart claimed by the
// user
$cumul_counterpart = $db->query("SELECT sum(if(quoi='piplome', 1, 0)) as piplomes,
sum(if(quoi='pibag', 1, 0)) as pibags,
sum(if(quoi='pishirt', 1, 0)) as pishirts,
sum(if(quoi='hoodie', 1, 0)) as hoodies
FROM contreparties
WHERE user_id = '".$f3->get('SESSION.id')."';");
$cumul_counterpart = $cumul_counterpart->fetch(\PDO::FETCH_ASSOC);
foreach (['hoodies', 'pishirts', 'pibags', 'piplomes'] as $key) {
if (!array_key_exists($key, $cumul_counterpart)) {
$cumul_counterpart[$key] = 0;
}
}
$cumul = $cumul_counterpart['hoodies'] * 250 + max(($cumul_counterpart['pishirts'] - $cumul_counterpart['hoodies']), 0) * 100 + max(($cumul_counterpart['pibags'] - $cumul_counterpart['pishirts'] - $cumul_counterpart['hoodies']), 0) * 50 + max(($cumul_counterpart['piplomes'] - $cumul_counterpart['pibags'] - $cumul_counterpart['pishirts'] - $cumul_counterpart['hoodies']), 0) * 30;
$cumul = $total - $cumul;
$db->query("UPDATE users SET total = '".$total."', cumul = '".$cumul."' WHERE id = '".$f3->get('SESSION.id')."'");
$result = $db->query("SELECT id, pseudo, email, total, cumul FROM users WHERE id='".$f3->get('SESSION.id')."' ");
$data = $result->fetch(\PDO::FETCH_ASSOC);
$f3->set('infos', $data);
$result = $db->query("SELECT id, pdf, decimale FROM dons WHERE user_id='".$data['id']."' and pdf!='' ");
$pdfs = array(); $pdfs = array();
foreach ($result->fetchAll(\PDO::FETCH_ASSOC) as $row) { foreach ($result->fetchAll(\PDO::FETCH_ASSOC) as $row) {
$pdfs[$row['pdf']] = $row; $pdfs[$row['pdf']] = $row;
} }
$addresse = $f3->get('container')['address_finder']->findByUserId((int) $data['id']); $addresse = $f3->get('container')['address_finder']->findByUserId((int) $user['id']);
$f3->set('adresse', $addresse); $f3->set('adresse', $addresse);
$f3->set('pdfs', $pdfs); $f3->set('pdfs', $pdfs);
} }
...@@ -80,25 +58,19 @@ class Perso extends Controller ...@@ -80,25 +58,19 @@ class Perso extends Controller
public function get_contreparties($f3) public function get_contreparties($f3)
{ {
// Chargement des contreparties de l'utilisateur // Chargement des contreparties de l'utilisateur
$db = $f3->get('DB'); $contreparties = $f3->get('container')['counterpart_finder']->findByUserId((int) $f3->get('SESSION.id'));
$result =$db->query("SELECT datec, status, quoi, taille, adresse_id FROM contreparties WHERE user_id='".$f3->get('SESSION.id')."' ORDER BY datec DESC"); $f3->set('contreparties', $contreparties);
$data = array();
foreach ($result->fetchAll(\PDO::FETCH_ASSOC) as $row) {
$data[] = $row;
}
$f3->set('contreparties', $data);
} }
public function get_dons($f3) public function get_dons($f3)
{ {
// Chargement des dons de l'utilisateur // Chargement des dons de l'utilisateur
$db = $f3->get('DB'); $db = $f3->get('DB');
$result = $db->query("SELECT datec, somme, id, pdf, status FROM dons WHERE user_id='".$f3->get('infos.id')."' AND status IN (1,4,102) ORDER BY datec DESC"); $dons = $f3->get('container')['donation_finder']->findByUserId((int) $f3->get('SESSION.id'));
$data = array(); $dons = array_filter($dons, function ($id) {
foreach ($result->fetchAll(\PDO::FETCH_ASSOC) as $row) { return in_array((int) $id, [1, 4, 102]);
$data[] = $row; });
} $f3->set('dons', $dons);
$f3->set('dons', $data);
} }
public function get_recurrents($f3) public function get_recurrents($f3)
...@@ -115,8 +87,6 @@ class Perso extends Controller ...@@ -115,8 +87,6 @@ class Perso extends Controller
public function login($f3, $args) public function login($f3, $args)
{ {
$f3->clear('SESSION.error');
$f3->clear('SESSION.message');
$f3->set('form_visible', 'login'); $f3->set('form_visible', 'login');
if ($f3->get('action')=='renew_password') { if ($f3->get('action')=='renew_password') {
...@@ -240,8 +210,7 @@ class Perso extends Controller ...@@ -240,8 +210,7 @@ class Perso extends Controller
if ($f3->get('email')!='') { if ($f3->get('email')!='') {
// On vérifie que l'adresse mail n'existe pas // On vérifie que l'adresse mail n'existe pas
$db = $f3->get</