What's about roles between integrated phpBB and Wordpress?
Posted: Sat Jul 28, 2018 9:58 am
The integration plugin phpBB Wordpress at date of this post, version 1.8.9 assume this behavior and can be adapted to assume another, following this rules:
when an user register in wordpress, it is added also in phpBB, by default into groups
Newly Registered and Registered which are default groups into a default phpBB installation.
IDs of these default phpBB groups are 2 and 7.
If these IDs groups (2 and 7) not exists into phpBB when the plugin add the user in phpBB, then you'll have to manually add after, this phpBB user into a phpBB group via ACP, making him belong to an existent phpBB group or will result registered, but belonging to no groups at all (because groups 2 and 7 not exists in phpBB).
This can be resolved editing file class.wp.w3all-phpbb.php where this code, inside the
private static function create_phpBB_user($wpu){
CHANGE the value 2 on this instruction where
'$phpbb_user_type','2'
into the phpBB group value you want the user added and belong to
and where this code:
change the code into (to be an unique single instruction)
and as above change the value 2 on this instruction, to fit the existent phpBB group ID which you want the user added when register on WP side (same group ID you've set on instruction above)
This aspect will be soon fixed with options that will be possible to choose on plugin admin page, without changing code on files (that is a wild way to do things into a plugin).
About the contrary, so on how a phpBB user is added into Wordpress, the answer to change behavior is on the second link of this post, with temporary related solution if you do not want the plugin to add users with the default behavior explained on the help install procedure, where
After Install Questions Help -> About users permissions, and how they are added on WP
Also this aspect will be fixed as soon offering options on plugin admin, but in the while:
Add phpBB users to custom WordPress groups/roles
[EDITED]
when an user register in wordpress, it is added also in phpBB, by default into groups
Newly Registered and Registered which are default groups into a default phpBB installation.
IDs of these default phpBB groups are 2 and 7.
If these IDs groups (2 and 7) not exists into phpBB when the plugin add the user in phpBB, then you'll have to manually add after, this phpBB user into a phpBB group via ACP, making him belong to an existent phpBB group or will result registered, but belonging to no groups at all (because groups 2 and 7 not exists in phpBB).
This can be resolved editing file class.wp.w3all-phpbb.php where this code, inside the
private static function create_phpBB_user($wpu){
Code: Select all
$w3phpbb_conn->query("INSERT INTO ".$phpbb_config_file["table_prefix"]."users (user_id, user_type, group_id, user_permissions, user_perm_from, user_ip, user_regdate, username, username_clean, user_password, user_passchg, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lastpost_time, user_lastpage, user_last_confirm_key, user_last_search, user_warnings, user_last_warning, user_login_attempts, user_inactive_reason, user_inactive_time, user_posts, user_lang, user_timezone, user_dateformat, user_style, user_rank, user_colour, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_topic_show_days, user_topic_sortby_type, user_topic_sortby_dir, user_post_show_days, user_post_sortby_type, user_post_sortby_dir, user_notify, user_notify_pm, user_notify_type, user_allow_pm, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_options, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_jabber, user_actkey, user_newpasswd, user_form_salt, user_new, user_reminded, user_reminded_time)
VALUES ('','$phpbb_user_type','2','','0','', '$wpur', '$wpul', '$wpunn', '$wpup', '0', '$wpue', '$user_email_hash', '', '', '', '', '', '', '0', '0', '0', '0', '0', '0', '0', '$wp_lang_x_phpbb', 'Europe/Rome', 'D M d, Y g:i a', '1', '0', '', '0', '0', '0', '0', '-3', '0', '0', 't', 'd', 0, 't', 'a', '0', '1', '0', '1', '1', '1', '1', '230271', '$uavatar', '$avatype', '0', '0', '', '', '', '', '', '', '', '0', '0', '0')");
'$phpbb_user_type','2'
into the phpBB group value you want the user added and belong to
and where this code:
Code: Select all
$w3phpbb_conn->query("INSERT INTO ".$phpbb_config_file["table_prefix"]."user_group (group_id, user_id, group_leader, user_pending) VALUES ('2','$phpBBlid','0','0')");
$w3phpbb_conn->query("INSERT INTO ".$phpbb_config_file["table_prefix"]."user_group (group_id, user_id, group_leader, user_pending) VALUES ('7','$phpBBlid','0','0')");
Code: Select all
$w3phpbb_conn->query("INSERT INTO ".$phpbb_config_file["table_prefix"]."user_group (group_id, user_id, group_leader, user_pending) VALUES ('2','$phpBBlid','0','0')");
This aspect will be soon fixed with options that will be possible to choose on plugin admin page, without changing code on files (that is a wild way to do things into a plugin).
About the contrary, so on how a phpBB user is added into Wordpress, the answer to change behavior is on the second link of this post, with temporary related solution if you do not want the plugin to add users with the default behavior explained on the help install procedure, where
After Install Questions Help -> About users permissions, and how they are added on WP
Also this aspect will be fixed as soon offering options on plugin admin, but in the while:
Add phpBB users to custom WordPress groups/roles
[EDITED]