Add phpBB users to custom WordPress groups/roles

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 1 MiB.

Expand view Topic review: Add phpBB users to custom WordPress groups/roles

Re: Add phpBB users to custom WordPress groups/roles

by axew3 » Sat May 19, 2018 7:48 am

what's strange is that before, your first test was working, and now not work.
at moment i'm little confused because i can't figure out what can cause the fact that isn't working in your side.
should be no reason, but since it is not working for you, then a reason should exists.
If you want i take a look to what happen on fly as i can, you'll may will send me via pm (making my life easy): credentials for phpmyadmin, ftp, and an administrator account setup, ready and working both in wp and phpBB.

But i really guess (hope) you'll have already resolve the mystery at this time.

Re: Add phpBB users to custom WordPress groups/roles

by mLgz0rn » Sat May 19, 2018 12:00 am

I have no idea why it dosnt work on my site then :/.

Nothing happens at all on my site.
They just keep the default "subscriber" role on then wordpress part, when I set the custom group as default in phpbb

Re: Add phpBB users to custom WordPress groups/roles

by axew3 » Mon May 14, 2018 4:41 pm

i've check it on fly right now, and all work fine, these steps i've do to resume:

on phpBB i've add another test group, that i've named another testgroup, and in phpBB db, on groups table, it is stored as another testgroup
exactly as it is (this is what you need).
I have a test user named makron in phpBB, and i want it added on a custom group of WordPress. User makron belong to
Pre-defined groups user is a member of
Newly registered users and Registered users
but belong also, as group default, to the group another testgroup
under User defined groups user is a member of

I've create so another test group in wordpress. On creating it, with the plugin you use, i've set:
as Role ID:
Role ID:
another-testg (this is what you need)

so using this parameters, i've edit class.wp.w3all-phpbb.php in this way, respectively, on
private static function verify_phpbb_credentials(){:
i've change this code:

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
with this code:

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 == 'another testgroup' ){
          $role = 'another-testg';
        } 
        else { $role = 'subscriber'; }  // for all others phpBB Groups default to WP subscriber
and on
public static function w3_check_phpbb_profile_wpnu($username){
i've change this code:

Code: Select all

if ( $phpbb_user[0]->group_name == 'ADMINISTRATORS' ){
      	  $role = 'administrator';
      	} elseif ( $phpbb_user[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[0]->group_name == 'ADMINISTRATORS' ){
      	  $role = 'administrator';
      	} elseif ( $phpbb_user[0]->group_name == 'GLOBAL_MODERATORS' ){
          $role = 'editor';
        } elseif ( $phpbb_user[0]->group_name == 'another testgroup' ){
          $role = 'another-testg';
        } 
        else { $role = 'subscriber'; }  // for all others phpBB Groups default to WP subscriber
and the result is ok, the user is correctly added on the needed wordpress custom group. That is.
I'm sorry that you can't get it work as you need! What happen on your side?

Re: Add phpBB users to custom WordPress groups/roles

by axew3 » Mon May 14, 2018 3:39 pm

should not, but i'll check also this

Re: Add phpBB users to custom WordPress groups/roles

by mLgz0rn » Mon May 14, 2018 2:54 pm

axew3 wrote: Mon May 14, 2018 1:42 pm you say this phpBB user that you go to test added in wp, belong to the respective group in phpBB as group default

because the user need to belong as DEFAULT to the group you need, try this by clicking on Make group default for member in case, in phpBB ACP -> manage users -> select the user -> Administer User -> Select form: -> Groups

if this is not the problem, then i need re-test but i'm quite sure the result will be ok. In any case i will re-test it as soon
The first thing I do when I add them to the groups in phpBB is click make group default for member.
Could it be a problem with them being members of other groups too?
Even though their default group is set to what I want?

Re: Add phpBB users to custom WordPress groups/roles

by axew3 » Mon May 14, 2018 1:42 pm

you say this phpBB user that you go to test added in wp, belong to the respective group in phpBB as group default

because the user need to belong as DEFAULT to the group you need, try this by clicking on Make group default for member in case, in phpBB ACP -> manage users -> select the user -> Administer User -> Select form: -> Groups

if this is not the problem, then i need re-test but i'm quite sure the result will be ok. In any case i will re-test it as soon

Top