david63 wrote: ↑
Sat Jun 27, 2020 7:25 am
BarneyC wrote: ↑
Sat Jun 27, 2020 2:57 am
I add Foo to registered Users
Why are you adding any user to the Registered Users group? All users should be in that group at all times
Ok, so if a user is in newly registered group he also has to be in the registered group, even though you never want him to have the permissions associated with registered users? That seems counterintuitive.
1) Why is there an option to remove users from registered users; what would be the point of doing that?
2) If you have a user Foo and he's only in group registered users, and you remove him from registered users (don't ask why), his group_id is still (2 = registered users) in the users table, even though he isn't actually in any groups. There's no warning or way to find users who are in no groups (by mistake or other reason); it doesnt complain that it can't change the group id in users because there is no other group to put there, or warn you that removing a user from registered uses is taboo. I think it *should* at least change the group id to 0, which would also make it easy to find users who are in no groups (and therefore are zombies that can't see any forums or do anything).
The *reason* for this is that I'm integrating phpBB with a website and I have to do things programmatically (and not with the buttons in the ACP).
- When a user is created on the main site, a phpBB user is created with the same user_id
- Users need to be added to groups based on their status; for example if they buy something they need to be put into the appropriate support group.
this allows us to easily allow access to the board without having anyone log-in again; in fact we've eliminated the phpBB login altogether. Syncing the user_ids allows users to have a different screen name on the board, since many users on the main site log in with their email address.
I *could* argue that add_user() *should* add the user to registered users if that's in fact required; if you add a user with group_id set to something else, it only adds them to that group. Since a user in newly registered group can never use his membership in registered users, I'm not sure why it's required, except maybe to make it so you don't have to add him to registered users once he reaches the newly registered quotas.