Correction envoie mail

This commit is contained in:
Yass 2026-03-02 09:13:53 +01:00
parent 8b094379ca
commit e3d85f7946
4 changed files with 32 additions and 11 deletions

View file

@ -22,10 +22,18 @@
FROM category"; FROM category";
if ($intLimit > 0){ if ($intLimit > 0){
$strRq .= " LIMIT ".$intLimit; $strRq .= " LIMIT :limit";
} }
return $this->_db->query($strRq)->fetchAll(); $rqPrep = $this->_db->prepare($strRq);
if ($intLimit > 0){
$rqPrep->bindValue(":limit", $intLimit, PDO::PARAM_INT);
}
$rqPrep->execute();
return $rqPrep->fetchAll();
} }
/** /**

View file

@ -22,11 +22,18 @@
$strRq = "SELECT image.* $strRq = "SELECT image.*
FROM image"; FROM image";
if ($intLimit > 0){ if ($intLimit > 0){
$strRq .= " LIMIT ".$intLimit; $strRq .= " LIMIT :limit";
} }
return $this->_db->query($strRq)->fetchAll(); $rqPrep = $this->_db->prepare($strRq);
if ($intLimit > 0){
$rqPrep->bindValue(":limit", $intLimit, PDO::PARAM_INT);
}
$rqPrep->execute();
return $rqPrep->fetchAll();
} }
} }

View file

@ -37,9 +37,15 @@
$strRq = "SELECT user_id, user_name, user_firstname, user_password, user_image, user_status, authorisation_name, user_pseudo $strRq = "SELECT user_id, user_name, user_firstname, user_password, user_image, user_status, authorisation_name, user_pseudo
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
WHERE user_mail = '".$strMail."'"; WHERE user_mail = :mail";
$arrUser = $this->_db->query($strRq)->fetch(); $rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":mail", $strMail, PDO::PARAM_STR);
$rqPrep->execute();
$arrUser = $rqPrep->fetch();
if (password_verify($strPwd, $arrUser['user_password'])){ if (password_verify($strPwd, $arrUser['user_password'])){
unset($arrUser['user_password']); unset($arrUser['user_password']);
return $arrUser; return $arrUser;
@ -236,7 +242,7 @@
/** /**
* Verifie sur le pseudo entré n'est pas déjà utilisé * Verifie sur le pseudo entré n'est pas déjà utilisé
* @param string $pseudo Pseudo a verifié * @param string $pseudo Pseudo a verifié
* @return array Tableau associatif (ou false si pas trouvé) * @return bool Le pseudo existe ou pas
*/ */
public function pseudoExists(string $pseudo): bool{ public function pseudoExists(string $pseudo): bool{
@ -244,6 +250,6 @@
$rq->bindValue(":pseudo", $pseudo, PDO::PARAM_STR); $rq->bindValue(":pseudo", $pseudo, PDO::PARAM_STR);
$rq->execute(); $rq->execute();
return $rq->fetchColumn(); return (bool)$rq->fetchColumn();
} }
} }

View file

@ -75,9 +75,9 @@
</section> </section>
<!-- Formulaire qui envoie la demande au contrôleur (shareProject) --> <!-- Formulaire qui envoie la demande au contrôleur (sendEmail) -->
<div class="card shadow-sm p-4 mb-5"> <div class="card shadow-sm p-4 mb-5">
<form method="post" action="index.php?ctrl=project&action=shareProject"> <form method="post" action="index.php?ctrl=project&action=sendEmail">
<input type="hidden" name="project_id" <input type="hidden" name="project_id"
value="{$objProject->getId()}"> value="{$objProject->getId()}">