Failing to compare passwords
-
I have been trying to get encrypted passwords to match against plain text passwords in a plugin am working on. This is what I have been using, however, I get password match failed.
add_filter('wp_authenticate_user', 'custom_authentication', 10 , 2); function custom_authentication($emailAdd, $password) { //include_once('././wp-includes/class-phpass.php'); global $wpdb, $wp_hasher, $formErr; if(1 > count($formErr->get_error_messages())){ //$wp_hasher = new PasswordHash(8, TRUE); $table = $wpdb->prefix.'finusers'; $results=$wpdb->get_row("SELECT * FROM $table WHERE email_address='$emailAdd'"); $hash = $results->password; if(wp_check_password($hash, $password)){ echo "Password Matched"; }else{ echo "Password Match Failed"; } } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Failing to compare passwords’ is closed to new replies.