Forum Replies Created
-
AuthorPosts
-
yan.kun0567
ParticipantOkay, the github one seems outdated… I’m out.
yan.kun0567
ParticipantOkay, so I investigated the code, and this is, in my opinion an an least very interesting bug? Why did nobody recognised this before?
On checking if the user has entered a new password (class.swpm-front-registration.php:274), you call wp_logout() BEFORE calling the update statement on the database. But wp_logout() cancels the execution of any following code as it seems.
`if (isset($member_info[‘plain_password’])) {
//Password was also changed so show the appropriate message
$msg_str = ‘<div class=”swpm-profile-update-success”>’ . SwpmUtils::_(‘Profile updated successfully. You will need to re-login since you changed your password.’) . ‘</div>’;
$message = array(‘succeeded’ => true, ‘message’ => $msg_str);
unset($member_info[‘plain_password’]);
wp_logout(); //Log the user out from the WP user session also.
SwpmLog::log_simple_debug(“Member has updated the password from profile edit page. Logging the user out so he can re-login using the new password.”, true);
}$wpdb->update($wpdb->prefix . “swpm_members_tbl”, $member_info, array(‘member_id’ => $auth->get(‘member_id’)));
$auth->reload_user_data();
}I can verify this, because any other input is lost too, if a new password is entered.
I’ve moved the call to logout to the end of the function by storing a bool value inside the if statement, if logout should be called, and now everything is working as expected. Now heading to github to create a merge request.
yan.kun0567
ParticipantI’ve also checked, that the correct values are posted, and yes, everything is included in the post-body.
yan.kun0567
ParticipantNope, referring to the table in the database. I’ve updated the plugin now to the newest version (previously installed was 3.4.x).
Interestingly, all users now have to reset their passwords, because the pw’s stored in cleartext aren’t supported by phpass.
After resetting the password, the new one is beeing hashed and looks like a proper wordpress/phpass entry.
Thanks for the support!
-
AuthorPosts