tout cassé (ㆆ_ㆆ)

This commit is contained in:
Yasder5 2026-02-19 21:35:45 +01:00
parent b11f67793a
commit 26c81bc3c6
8 changed files with 50 additions and 35 deletions

View file

@ -18,7 +18,7 @@
* @return array
*/
public function findAllUsers():array{
$strRq = "SELECT user_id, user_firstname, user_name, user_image, user_status, authorisation_name
$strRq = "SELECT user_id, user_firstname, user_name, user_image, user_status, authorisation_name, user_pseudo
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
WHERE user_deleted_at IS NULL";
return $this->_db->query($strRq)->fetchAll();
@ -32,7 +32,7 @@
*/
public function verifUser(string $strMail, string $strPwd):array|bool{
$strRq = "SELECT user_id, user_name, user_firstname, user_password, user_image, user_status, authorisation_name
$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
WHERE user_mail = '".$strMail."'";
@ -154,7 +154,7 @@
*/
public function findUserById(int $intId): array|bool {
$strRq = "SELECT * FROM users WHERE user_id = :id";
$strRq = "SELECT user_name, user_firstname, user_pseudo, user_mail, user_password, user_phone, user_work, user_location, user_description FROM users WHERE user_id = :id";
$prep = $this->_db->prepare($strRq);
$prep->bindValue(':id', $intId, PDO::PARAM_INT);
@ -173,4 +173,13 @@
return $prep->fetch();
}
public function pseudoExists(string $pseudo): bool{
$rq = $this->_db->prepare("SELECT 1 FROM users WHERE user_pseudo = :pseudo LIMIT 1");
$rq->bindValue(":pseudo", $pseudo, PDO::PARAM_STR);
$rq->execute();
return (bool)$rq->fetchColumn();
}
}