Page 3 of 3

Re: User registration is broken in version 2.9.2

Posted: Sat Apr 26, 2025 5:35 pm
by axew3
No because it is a behavior completely not about the integration plugin but due to the UM way to setup data for users when they register.

Re: User registration is broken in version 2.9.2

Posted: Sat Apr 26, 2025 5:39 pm
by Ezrael
Due to the fact I don’t use the phpbb registration and all users have to be registered via Wordpress UM I think this bug doesn’t effect me.

After registration user are automatically linked to the WP UM Login which starts the user integration into phpbb after the first login.

Re: User registration is broken in version 2.9.2

Posted: Sat Apr 26, 2025 5:53 pm
by axew3
To be sure to not fall into problems, maybe just check that into the Deactivated phpBB users list (phpBB ACP) there are no emails that are good instead. Or to start by a good point, having users registering only into WP, just delete into phpBB in one click all deactivated users.
When you'll delete users in WP they will be set as deactivated in phpBB (if not using the phpBB extension and the option active into the plugin to delete users in phpBB when deleted in WP) and will never be able to register into WP again (because the email exist into phpBB but the user is deactivated).
Please wait the coming soon 2.9.5 (i hope this night my time) before to proceed with further tests.

Re: User registration is broken in version 2.9.2

Posted: Sat Apr 26, 2025 6:43 pm
by Ezrael
To be honest I have thought that behaviour of the plugin is perfect.

After user deleted themself via Wordpress, phpbb deactivate their accounts instead of deleting them.

This kept their posts in the forum and prevented a new registration with the same email. I have thought that’s a security feature 🤣😂🤣

Re: User registration is broken in version 2.9.2

Posted: Sat Apr 26, 2025 7:38 pm
by axew3
Yes it is in effect like an antispam!

Re: User registration is broken in version 2.9.2

Posted: Sun Apr 27, 2025 9:58 am
by axew3
So, standing on latest fixes and my tests with Ultimate member login when an user exist into phpBB but not still in WP:
the last added function into the wp_w3all.php file that hook into authenticate

Code: Select all

add_filter( 'authenticate', 'wp_w3all_login_existent_phpbb_fix', 5, 3 );
so the function
wp_w3all_login_existent_phpbb_fix
should be like this, to be compatible with UM login/registration flow:

Code: Select all

 function wp_w3all_login_existent_phpbb_fix($user, $username, $password){

    if(!empty($username) && !empty($password)){

      WP_w3all_phpbb::w3_check_phpbb_profile_wpnu($username);

      $eu = is_email($username) ? 'email' : 'login';
      $u = get_user_by($eu, $username); # maybe a direct query should be necessary?

      if(!empty($u))
      {
        $user = $u; # Good for all
        # Good for UM: if the user has been created by 'w3_check_phpbb_profile_wpnu', activate the user on Ultimate Member
      	 if(defined('um_plugin') && defined('WPUSERCREATED')){ # create the record 'um_member_directory'_data into wp_usermeta tab
      	   $result = UM()->common()->users()->approve($u->ID); # activating the user x UM when a new user has been created onlogin because existent into phpBB
         }
      }
    }

    # return the user object, if the user has been created by 'w3_check_phpbb_profile_wpnu'

   return $user;
  }
This cause the user insertion onlogin into WP via a front end page where there is the UM login form, if the user exist into phpBB: firing the authenticate before UM, adding him to WP via w3_check_phpbb_profile_wpnu then approving into UM.