Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getUserByEmailAndPassword($email, $password) {
- $stmt = $this->conn->prepare("SELECT * FROM UZYTKOWNICY WHERE EMAIL = ?");
- $stmt->bind_param("s", $email);
- if ($stmt->execute()) {
- $user = $stmt->get_result()->fetch_assoc();
- $stmt->close();
- $salt = $user['SALT'];
- $encrypted_password = $user['ENCRYPTED_PASSWORD'];
- $hash = $this->checkhashSSHA($salt, $password);
- if ($encrypted_password == $hash) {
- return $user;
- }
- } else {
- return NULL;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement