News:

Wondering if this will always be free?  See why free is better.

Main Menu

Setting primary member group after conversion

Started by jsdoyle, August 14, 2005, 09:49:29 AM

Previous topic - Next topic

jsdoyle

After a conversion from phpbb to smf 1.05 my membergroups converted fine but none of the members have a "primary group" setting.  They are listed as members of groups listed in the "Additional Groups" list.  Is there a way to set their "primary group" to one of the specific groups in the list without having to do it one member at at time?

Is there an advantage to having them set to a primary group?  Should I even worry about doing this?

Thanks,

Scott

[Unknown]

I wouldn't worry about it.

The primary group is the displayed group.  The additional groups are the ones no one can see.  They both apply the same way, otherwise.

-[Unknown]

jsdoyle

Thanks Unknown.

There is no member group displayed for all of my members after the conversion.  So I have groups called "Members" and "Public" but these are only listed in the Additional Groups section.  None of the converted members show a primary group.

Now this normally would not cause a problem but I'm using MKPortal to add some features to my forum.  With no primary membergroup the permissions are screwed up.  MKPortal looks at the Primary Group ID for its permissions.  Since none of my members have no Primary Group ID then the "Members" and "Public" are treated the same.

So, I would suggest that the conversion mod be changed to place the first group ID in the ID_GROUP field of the members table.

For me it's too late.  I have to go in and manually assign a primary group to every member (580).

Or, if you know mySQL and can write me a statement that will change the primary group ID to the first listed additional group that would really save me some time.

Something like:

Set "ID_GROUP" = "200" for each "additionalGroups" that contain "200"

The contain part is necessary because some may have more than one group in the field separated by commas.

Thanks for your help.

Scott

[Unknown]

Why do they all need to be in these groups primarily?  Can't you use post groups for that (which are automatic)?

UPDATE smf_members
SET ID_GROUP = 200, additionalGroups =
   CASE
      WHEN additionalGroups = '200' THEN ''
      WHEN additionalGroups LIKE '%,200' THEN LEFT(additionalGroups, LENGTH(additionalGroups) - LENGTH(',200'))
      WHEN additionalGroups LIKE '200,%' THEN RIGHT(additionalGroups, LENGTH(additionalGroups) - LENGTH('200,'))
      ELSE REPLACE(additionalGroups, ',200,', '')
   END
WHERE ID_GROUP = 0
   AND FIND_IN_SET(200, additionalGroups);

Backup first.  What is phpMyAdmin?

-[Unknown]

jsdoyle

Why have so many groups?

I run the website for an international organization (www.afte.org) and we have multiple levels of access to different boards.  I have created board rooms for the various committees within the organization.  Only members of those committees can see those boards.   So, they are members first and then added to additional groups as necessary.  The committees members change from year to year and some members are on multiple committees.  By having them set to be in the "members" group as  a primary group they have that base permission set and it extends over to MkPortal.

Thanks for the sql statement!  I'll give it a try later tonight.

Scott

[Unknown]

Ah, so "Committee Members" in other words.  I thought it was like "members" as in... members.

-[Unknown]

jsdoyle

yes, we have several member types.  I can't let it automatically assign registrants to a group.  Anyone registering for this forum is approved by me and I have to check their names against our main roster.  If they are not a member they go into the "AFTE Friends" group and can only post to our public categories.

Because our organization is primarily Law Enforcement they are very security conscious.  One reason for switching from phpBB to SMF.

Thanks,

Scott

Advertisement: