Hi, ok i've just install on fly and all work as expected at point 1 (the best you can hope).
Steps i've do/check:
i have a test group in phpBB, named
Atestgroup
so i've move a test user named
aguest to this
Atestgroup group in phpBB
AND i've set it as default group for this user.
So into WP, after installation of this plugin you use, i've create a group: you note that when you create a group you have the field
Role ID:
the
role id, is so stored for each user as capabilities in WP,
i've create one giving it role-id: custom-editor
you can check this value after,
in WP database -> usermeta -> [column] meta_key ->
capabilities
how this value is stored for each user.
So i've change the code of
class.wp.w3all-phpbb.php where:
Code: Select all
if ( $phpbb_user_session[0]->group_name == 'ADMINISTRATORS' ){
$role = 'administrator';
} elseif ( $phpbb_user_session[0]->group_name == 'GLOBAL_MODERATORS' ){
$role = 'editor';
} else { $role = 'subscriber'; } // for all others phpBB Groups default to WP subscriber
into this:
Code: Select all
if ( $phpbb_user_session[0]->group_name == 'ADMINISTRATORS' ){
$role = 'administrator';
} elseif ( $phpbb_user_session[0]->group_name == 'GLOBAL_MODERATORS' ){
$role = 'editor';
} elseif ( $phpbb_user_session[0]->group_name == 'Atestgroup' ){
$role = 'custom-editor';
} else { $role = 'subscriber'; } // for all others phpBB Groups default to WP subscriber
I've delete the
aguest user in WP and reactivated him in phpBB to test the addition in WP another time (because you know that when you delete an user in wp it become deactivated in phpBB).
So when
aguest user logged in phpBB, and come in WP side, or login WP first time, it is correctly added into needed
custom-editor group. Work OK.
Note:
$phpbb_user_session[0]->group_name == 'Atestgroup'
Atestgroup is the
group_name assigned for this phpBB group on db table
yourPrefix_groups.
You'll go to add as above, any groups you want in the same way adding more
elseif:
Code: Select all
elseif ( $phpbb_user_session[0]->group_name == 'AnotherNamedphpBBGroup' ){
$role = 'another-custom-role-id';
}
NOTE: i've note also this: if i have an user, and it belong to registered or newly registered group, then i add him to another custom group, you see that it belong to all these groups BUT, the one resulting as it is, can be still registered or newly registered:
you need to click ->
Make group default for member to set it as default group for this member!
Setup phpBB to assign the default group which the user belong to, as you want.
On this online example, if i'm not wrong, i've setup phpBB users to: be newly registered when they register, then they are moved into registered as default, after first post approved.
I think this is also the problem about this recurrent question:
"i setup widgets to retrieve posts based on phpBB user permissions, but this user can see posts from forums where he should not."
This things could be coded to be an option, but in the wild (and in the while) this is the joke to apply.
I've discovered a little bug, when an new user is added in WP coming from phpBB:
PHP Notice: Undefined variable: wp_lang_x_phpbb in wp46/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php on line 997
going to fix it as soon.
Hope ive been clear
cheers
ps: the the file class.wp.w3all-phpbb.php has been patched to fix the php notice error, check it here
https://wordpress.org/support/topic/1-8 ... t-10249334
[EDITED]