Re: How to sync WP role to phpBB group?
Posted: Wed Oct 17, 2018 9:38 pm
Actually both the transfer process and new registration. Today we have 2000+ users in Joomla and use a bridge with phpBB but we're moving to Wordpress and want to keep phpBB. I already managed to transfer all users into Wordpress and since we used several groups in Joomla I converted them into roles in Wordpress. I'm using the WP-Members plugin to have support for custom registration, fields and roles. WP-Members stores all it's information in the standard Wordpress usermeta table which is nice.
So with this setup I'm able to assign different roles to my users and can manage their permissions based on those roles. In phpBB we already have a complex permission structure with groups where users can be member in several phpBB groups.
So basically what I try to achieve is to have the feature to managing all permissions in Wordpress by assigning several roles to the users and have that synchronized to phpBB.
Here's an example how the role membership looks in the database in Wordpress when WP-Members stored this.
This seems to be a serialized string which displays like this.
Btw. these strange role names are different member levels in the Swedish language
/Tomas
So with this setup I'm able to assign different roles to my users and can manage their permissions based on those roles. In phpBB we already have a complex permission structure with groups where users can be member in several phpBB groups.
So basically what I try to achieve is to have the feature to managing all permissions in Wordpress by assigning several roles to the users and have that synchronized to phpBB.
Here's an example how the role membership looks in the database in Wordpress when WP-Members stored this.
Code: Select all
mysql> SELECT meta_value FROM wp_usermeta WHERE user_id = '2237' AND meta_key = 'wp_capabilities';
+-------------------------------------------------------------------------------+
| meta_value |
+-------------------------------------------------------------------------------+
| a:3:{s:11:"klubbmedlem";b:1;s:14:"styrelsemedlem";b:1;s:10:"guldmedlem";b:1;} |
+-------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Btw. these strange role names are different member levels in the Swedish language
Code: Select all
[tomas@laptop ~]$ php <<EOF
> <?php print_r(unserialize('a:3:{s:11:"klubbmedlem";b:1;s:14:"styrelsemedlem";b:1;s:10:"guldmedlem";b:1;}')); ?>
> EOF
Array
(
[klubbmedlem] => 1
[styrelsemedlem] => 1
[guldmedlem] => 1
)