params = $params; } public function fetchDatas($email) { try { $pdo = PdoConnect::getInstance(); $dbh = $pdo->connect($this->params->get('urlDatabase'), $this->params->get('dbUser'), $this->params->get('dbPassword')); $query = $dbh->prepare($this->getParameter('queryFetchDatas')); $query->execute(['email'=> $email]); $datas = $query->fetch(PDO::FETCH_ASSOC); } catch (PDOException $e) { print "Erreur !: " . $e->getMessage() . "
"; die(); } return $datas; } public function verifyPassword($password, $hashedPassword) { $hashMethod = $this->params->get('hashMethod'); switch ($hashMethod){ case "sha1": return $hashedPassword === sha1($password, false); break; case "md5": return $hashedPassword === md5($password); break; case "BCRYPT": default: return password_verify($password, $hashedPassword); break; } } }