Advertisement
Guest User

Untitled

a guest
Jan 6th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. $stmt = $this->conn->prepare("SELECT * FROM users WHERE email=?");
  2. $stmt->bind_param('s', $email);
  3. if ($stmt->execute()) {
  4. $stmt->bind_result($id,$unique_id,$name,$email,$encrypted_password,$salt,$created_at,$updated_at);
  5. $user = $stmt->fetch();
  6. $stmt->close();
  7.  
  8.  
  9. // verifying user password
  10. $salt = $user['salt'];
  11. $encrypted_password = $user['encrypted_password'];
  12. $hash = $this->checkhashSSHA($salt, $password);
  13. // check for password equality
  14. if ($encrypted_password == $hash) {
  15. // user authentication details are correct
  16. return $user;
  17. }
  18. } else {
  19. return null;
  20. }
  21. }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement