Hello all!
I need some help with a CMS i'm editing. I've changed it hashing to ordinary md5 on register, but it won't work logging in.
I've tried to edit a lot, but i only manage to edit it to connect with whatever password i want.
The code is;
final public function passValidation($username, $password) { global $db, $core; $conn = $db->PDO(); try { $stmt = $conn->pdo->prepare('SELECT `password` FROM `users` WHERE `username` = :u LIMIT 1'); $stmt->bindParam(':u', $username, $db->PARAM_STR); $stmt->execute(); if(password_verify($password, $stmt->fetchColumn())) { return true; } return false; } catch(PDOException $e) { die($e->getMessage()); } $conn = null; }
Any idea what i have to edit, to access the CMS with correct hashed md5 password typed in?
I need some help with a CMS i'm editing. I've changed it hashing to ordinary md5 on register, but it won't work logging in.
I've tried to edit a lot, but i only manage to edit it to connect with whatever password i want.
The code is;
final public function passValidation($username, $password) { global $db, $core; $conn = $db->PDO(); try { $stmt = $conn->pdo->prepare('SELECT `password` FROM `users` WHERE `username` = :u LIMIT 1'); $stmt->bindParam(':u', $username, $db->PARAM_STR); $stmt->execute(); if(password_verify($password, $stmt->fetchColumn())) { return true; } return false; } catch(PDOException $e) { die($e->getMessage()); } $conn = null; }
Any idea what i have to edit, to access the CMS with correct hashed md5 password typed in?