Page 9 of 11

Re: 2.8.8 template integration improvements and 2.8.8 pre-logs

Posted: Sun Jul 07, 2024 6:03 am
by axew3
Good morning!
Let test and return back.

Anyway often, there are possibilities that are not immediately obvious, like to add users as a specified group into phpBB when they register into WP.
Same for phpBB when users are added into WP because they register into phpBB.
Beside this, going to test this aspect right now...

Re: 2.8.8 template integration improvements and 2.8.8 pre-logs

Posted: Sun Jul 07, 2024 6:05 am
by Ezrael
Note: That's the situation for me but I don't use the phpbb registration anymore. The only way to register on my website is the WP registration even if you press on register in the phpbb.

I found this issue because some bots started to register. Luckily I recognised it directly.

Re: 2.8.8 template integration improvements and 2.8.8 pre-logs

Posted: Sun Jul 07, 2024 6:52 am
by axew3
Ok reproduced. It is just like you say, it simply do not work. The user is added as active into phpBB.
Fixing...

Re: 2.8.8 template integration improvements and 2.8.8 pre-logs

Posted: Sun Jul 07, 2024 7:43 am
by axew3
Ok
file /class.wp.w3all-phpbb.php
It is very strange that this line appear to be like this:

Code: Select all

if( current_user_can('create_users') === true OR $action = 'add_u_phpbb_after_login' ){ // an admin adding user
it is wrong because OR $action = 'add_u_phpbb_after_login' always return true, so the condition set by the way to 0 the value (user active).
it is clear that it need to be changed into this instead:

Code: Select all

if( current_user_can('create_users') === true OR $action == 'add_u_phpbb_after_login' ){ // an admin adding user
testing flow...
but i assume it will be changed into

Code: Select all

 if( current_user_can('create_users') === true ){ // an admin adding user
after more changes/additions on code so to satisfy all options requirements

[EDITED]

Re: 2.8.8 template integration improvements and 2.8.8 pre-logs

Posted: Sun Jul 07, 2024 7:53 am
by Ezrael
Whats the normal behaviour, if someone register in wp and hasn't used the activation link?

The situation I now looks okay for me because als long as the user hasn't logged in to Wordpress your plugin doesn't add the user to phpbb.

After the first login the users gets transferred and activated in phpbb

Re: 2.8.8 template integration improvements and 2.8.8 pre-logs

Posted: Sun Jul 07, 2024 8:07 am
by axew3
Fixed.
Substantially the fix change this code:

Code: Select all

      // check that the user need to be added as activated or not into phpBB

        if( current_user_can('create_users') === true OR $action = 'add_u_phpbb_after_login' ){ // an admin adding user
          $phpbb_user_type = 0;
        } else {
          $phpbb_user_type = $w3all_phpbb_user_deactivated_yn;
        }
into this instead (or something like this):

Code: Select all

      // check that the user need to be added as activated or not into phpBB

        $phpbb_user_type = 0;
        
        if( current_user_can('create_users') === true ){ // an admin adding user
          $phpbb_user_type = 0;
        } elseif( ! current_user_can('create_users') && $w3all_phpbb_user_deactivated_yn == 1 ) {
        	$phpbb_user_type = 1;
        }
        
        if( ! current_user_can('create_users') && $action == 'add_u_phpbb_after_login' ){
          return;
        }
on file /class.wp.w3all-phpbb.php
inside the function
private static function create_phpBB_user($wpu, $action = ''){
this should fix all... let continue tests