Ultimate Members login issue

cryptocollege
Posts: 1
Joined: Mon May 27, 2019 10:59 am

Ultimate Members login issue

Post by cryptocollege » Mon May 27, 2019 11:18 am

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

User avatar
axew3
w3all User
w3all User
Posts: 1680
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Ultimate Members login issue

Post by axew3 » Fri May 31, 2019 10:53 pm

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: Select all

 wp_set_password( $changes['user_pass'], um_user( 'ID' ) );
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: Select all

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;
change/replace with this:

Code: Select all

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;
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.

Post Reply