Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $stmt = $this->conn->prepare("SELECT * FROM users WHERE email=?");
- $stmt->bind_param('s', $email);
- if ($stmt->execute()) {
- $stmt->bind_result($id,$unique_id,$name,$email,$encrypted_password,$salt,$created_at,$updated_at);
- $user = $stmt->fetch();
- $stmt->close();
- // verifying user password
- $salt = $user['salt'];
- $encrypted_password = $user['encrypted_password'];
- $hash = $this->checkhashSSHA($salt, $password);
- // check for password equality
- if ($encrypted_password == $hash) {
- // user authentication details are correct
- return $user;
- }
- } else {
- return null;
- }
- }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement