News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Copy main user group to secondary

Started by Nilom, June 30, 2016, 02:35:04 PM

Previous topic - Next topic

Nilom

Hello all,

I'm currently doing some rework on my permission system and I'm in the need of putting 1 member group that people has as main and copy it to a secondary group as well.

Example:
User has "Lol" as main user group.

I want User to have "Lol" as main user group and secondary user group as well.

Thanks i advance!

Illori

why as main and secondard? if the group is their main group assigning as secondary will do nothing at all. they only need to be in the group 1 time, i am not even sure you can even assign the user to a group more then 1 time.

if you change their primary membergroup and then assign it to the secondard that would work if you dont want the group to be primary/visible.

Nilom

Thanks for the reply.

I have a custom built addon that is kind of broken. Instead of rebuilding it it would be easier to just change user groups on the users who need it.
Since there is 2500 that need to be changed I thought maybe there is an code you can do in phpmyadmin or something similar.

You can have main user group and secondary at the same time.

Illori

we dont recommend playing directly in the database unless you 100% know what you are doing.

Sir Osis of Liver

You can run a mysql query in phpmyadmin to update id_group in smf_members from one group to another, changing all 2500 members in one shot, but as Illori posted, it's not recommended because tables are linked, and you could break something.  Offhand, don't see how it would be any different from changing a member's group in profile, but it's not something I would attempt without having a good database backup.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Nilom


Advertisement: