Page 1 of 1
Group not set in phpBB for new WP registered user
Posted: Thu Apr 26, 2018 2:14 pm
by OXO
And as a result, they cant see any forum sections.
I have seen the other topics on this here, but i dont understand whats required to fix this. Can someone make it clear?
Re: Group not set in phpBB for new WP registered user
Posted: Thu Apr 26, 2018 2:53 pm
by axew3
Let see if possible to understand all the joke without and before i'll (or someone else, but nobody until now have come out) re-look the code.
This is on my test:
into a default phpBB test install, there is a forum that i've create and dedicated to a specific group, so nobody that not belong to this group can see this forum listed in phpBB.
When an user is added via wordpress registration, in phpBB it is added (and belong) to two groups:
Newly registered users
and
Registered users
according on this, when i open wordpress with a test user that not belong to this group, but only to Newly registered users and Registered users, this user can't see latest posts from this forum on the widget.
So: are you sure that this forum, not contain the permission for these two groups, to access it?
See it on: ACP -> TAB Permissions -> Forum permissions -> select a forum and check what groups can access it
???
Re: Group not set in phpBB for new WP registered user
Posted: Thu Apr 26, 2018 3:22 pm
by OXO
Its already correct for groups.
What happens is that users who register via Wordpress get created in phpBB with no group set.
Users created in phpBb registration do get groups set.
Here are 2 users I created - one by WP website and the other by forum. See that the website one has no group, and blank group has no access.
- forum.jpg (149.56 KiB) Viewed 2346 times
The attachment forum.jpg is no longer available
Re: Group not set in phpBB for new WP registered user
Posted: Thu Apr 26, 2018 5:05 pm
by OXO
Wordpress registration.
- WP.jpg (147.02 KiB) Viewed 2343 times
Re: Group not set in phpBB for new WP registered user
Posted: Thu Apr 26, 2018 6:24 pm
by axew3
What happens is that users who register via Wordpress get created in phpBB with no group set.
Asking my self how it can happen
the
private static function create_phpBB_user($wpu){
on file
class.wp.w3all-phpbb.php
execute these inserts for users:
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')");
$w3phpbb_conn->query("INSERT INTO ".$phpbb_config_file["table_prefix"]."acl_users (user_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES ('$phpBBlid','0','0','6','0')");
i assume that by the way, this add the user into the mentioned defaults users groups, but maybe this is not true on your or some other case: strange because these are default not changeable groups in phpBB for what i know ...
you say these new wp users are added into phpBB and they results to not belong to any group: so it is also strange that after the result is that these users can see posts on widgets because the query, if no group isset for this user, should thrown error on mysql instruction inside functions that retrieve posts.
In case this user is inserted into these defaults groups, which into your phpBB as you have setup it, aren't considered?
On my tests it work, that not mean work in any case ... Little confused at moment by all the above...
[EDITED]