Page 1 of 1

Ultimate Members login issue

Posted: Mon May 27, 2019 11:18 am
by cryptocollege
First of sorry for posting my issue in probably the wrong section. Im feeling quite helpless :(

My website crypto-college.nl uses your Ultimate Members plugin to register and login users. It worked fine untill this morning, when the login form broke. The registration proces seems fine, and accounts get activated when users click the link in the email. But when they come to login the system keeps telling them the password is incorrect. When u use password reset the same problem occurs.

how to solve this issue?

thanks!

gr
rob

Re: Ultimate Members login issue

Posted: Fri May 31, 2019 10:53 pm
by axew3
OBSOLETE, read this topic instead:
viewtopic.php?t=1864

For a more clear topic about this, same post/answer into another older topic copied here.
Please follow here if necessary.

So, about the Ultimate Member password problem:

All work fine, into wp_admin side, so when an user update his profile into native
/wp-admin/profile.php page
or an admin update an user via wp_admin page.

Pass update do not work into the frontend Ultimate Member profile page, when the user update his profile via UM pages because in this case, the Ultimate member do not fire the native
profile_update wp hook.

On UM profile updates, when pass changes, it just do this on file /ultimate-member/includes/core/um-actions-account.php
[code] wp_set_password( $changes['user_pass'], um_user( 'ID' ) );[/code]

So i've try to use native UM hooks, as they are documented on code files, and of course i resolved the problem but, i had to add a function into the integration plugin, an hook, and edit another integration plugin function: UM in this case work fine but, throw/return an error to the user profile, and say Error Occurred on updating to the user, even if the password correctly changed/updated. To suppress the UM "An error occurs on update" notice, was necessary more code.

To not investigate more looking how UM throw errors, suppressing the js that fire the notice to the user on profile, and to be more short,
to fix i've try do this:

FIX Ultimate Member pass update/change on UM user's profile page:


since wp_set_password use/fire wp_hash_password we could do this then ...

open wp_w3all.php file and
where this code:
[code]
if ( ! function_exists( 'wp_hash_password' ) && ! defined("WPW3ALL_NOT_ULINKED") ) :

function wp_hash_password( $password ) {

$pass = WP_w3all_phpbb::phpBB_password_hash($password);
return $pass;

}

endif;[/code]

change/replace with this:

[code]if ( ! function_exists( 'wp_hash_password' ) && ! defined("WPW3ALL_NOT_ULINKED") ) :

function wp_hash_password( $password ) {
$pass = WP_w3all_phpbb::phpBB_password_hash($password);
if ( ! defined( 'WP_ADMIN' ) && class_exists( 'UM' ) ) {
global $w3all_config,$wpdb;
$w3phpbb_conn = WP_w3all_phpbb::wp_w3all_phpbb_conn_init();
$current_user = wp_get_current_user();
$wp_user_data = get_user_by( 'ID', $current_user->ID );
$phpBB_user_pass_set = WP_w3all_phpbb::phpbb_pass_update_res($wp_user_data, $pass);
$w3phpbb_conn->query("UPDATE ".$w3all_config["table_prefix"]."users SET user_password = '$pass' WHERE username = '".$current_user->user_login."'");
}
return $pass;
}

endif;
[/code]

Should work fine.
It's strange that email is not a problem, it's correctly updated, while the password not on UM frontend profile page. I've not follow all the code flow, just find out a way to resolve in short and within integration plugin. Let know if further problems with ultimate member plugin.

Someone asked time ago to integrate also UM avatar like for buddypress.