public function check_password($password) { $user = $this->get_user(); if ($user === FALSE) { // nothing to compare return FALSE; } $hash = $this->hash_password($password, $this->find_salt($user->password)); return $hash == $user->password; }