![]() |
Bulk change of User Group based on User Profile fields
Can anyone suggest a way of changing the User Group for groups of current users based on data in custom User Profile Fields.
For example, I have international users from different countries, and their country of residence is show in a custom User Profile Field. If I want to change the Primary User Group for all the users in say "Japan" is this possible without having to do each user separately... for a large group with would clearly be almost impossible.:eek: Any help or tips would be greatly appreciated. Steve |
You can change the usegroup using a query, like:
Code:
UPDATE user SET usergroupid=X WHERE fieldY='Japan' where of course X is the id of the new group for Japan users, and Y is the id of your custom profile field. But I think if you do it that way, it's possible that not everything gets updated as it should when a usergroup is changed. What you might do is make a "temporary Japanese" usergroup, use the above query to move all "Japan" users to the temporary group, then use "Move/Prune Users" to move then from the temporary group to the Japan group. |
Thanks kh99
I guess you run the query from the Maintenance section. But were's the switch to allow running of queries. I seem to have that turned off for administrators on my board. |
You can use the Maintenance section or use phpMyAdmin if you have that available.
There's a variable in the config.php where you have to add the userid of users allowed to do queries. I feel like I should add that you should be very careful, and probably you should have a backup before you start changing things. |
Thanks again.
Got that... I think phpMyAdmin is best... I can see what I'm doing a lot clearer! and I can see how easily it can be to stuff things up.. so I'll take the Backup advice!~ Cheers |
All times are GMT. The time now is 01:05 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|