News:

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

Main Menu

Moderators in Usergroup

Started by Wyld, February 24, 2005, 10:31:28 PM

Previous topic - Next topic

Wyld

Howdy,

Not sure if there is a way to do this in SMF, so I thought I would ask.

I'm looking to use SMF for a large gaming community, but to do so, I need to be able to assign a moderator to a usergroup, usergroup to forums.  The moderator provides control over the group, for their postings (in the forums assigned to that group) and to adding and removing members from that usergroup.

This last part, is where I am stumbling.  Any ideas?

Oldiesmann

Unfortunately, SMF doesn't support this. However, if you use Grudge's Member Specific Permissions mod, I can show you how to hack the "manage membergroups" permission a bit to allow anyone with that permission to add/delete members only from the group they belong to (SMF already prevents people with this permission from making themselves administrators...).
Michael Eshom
Christian Metal Fans

Ruth

Please post for us all!! :)

I have several clients that would LOVE to have this ability.

Ruth

I just tried the link you posted and got this error:

"The topic or board you are looking for appears to be either missing or off limits to you."

:(


Wyld

Quote from: Oldiesmann on February 25, 2005, 01:28:10 PM
Unfortunately, SMF doesn't support this. However, if you use Grudge's Member Specific Permissions mod, I can show you how to hack the "manage membergroups" permission a bit to allow anyone with that permission to add/delete members only from the group they belong to (SMF already prevents people with this permission from making themselves administrators...).

I am looking to run SMF to run a significantly large online gaming community, that hosts one of the largest perminant worlds in the Neverwinter Nights game.  Now, we have a *large* userbase, and maybe 20 admins (ranging from in game admins called DMs through to coders). 

Let me give you a rundown of the exact requirement I have.

I have two membergroups ..
  "OoA Members" with 40 people in it, who get the ability to use a hidden forum.
  "OoA Leaders" with 3 people in it, who get the ability to moderate the OoA Members forum and use the OoA Leaders forum.

The end goal is to allow "OoA Leaders" to add and remove users to the "OoA Members" group. 

The other side to this is having one single admin account (not held by a user, it will be called Webmin and its role is to setup and admin the system), whilst interaction with the userbase will be done by the people who run the game.  This would mean (as far as I can see) all DMs and Coders being made Global Moderators - and somehow alling Global Moderators the power to be effectivly mini admins.

However, I need to assign a dummy user as a Global Mod and see *exactly* what he can and cant do first to assess this side of it.  So for now, if you can assist with the first case above, that would be great.

Ruth

I'm in a similar boat. We have a group with private area boards... so those in Calgary AB can see the Calgary AB board. Then there are Regional Moderators who are both in a local group (such as Calgary AB) and in a group that gives them access to a moderators board where they post to say "please add so-n-so to the Calgary AB board).

What I'd like is to make certain users the "moderator" of the group so they can add users or remove users without asking the admin to do it. Obviously I only want them to be able to add/remove from the one group.

Oldiesmann

#7
I decided that modifying the "manage_membergroups" permission wasn't the best way to do things (although it's the easiest), so here's how to add a "moderate own group" permission that will give them permission to add/remove people from their own groups (both primary and secondary groups - let me know if that's a problem and I can fix it).

Sources/ManagePermissions.php

Find
$groupLevels['global']['maintenance'] = array_merge($groupLevels['global']['moderator'], array(
'manage_attachments',
'manage_smileys',
'manage_boards',
'moderate_forum',
'manage_membergroups',
'manage_bans',
'admin_forum',
'manage_permissions',
'edit_news',
'calendar_edit_any',
'profile_identity_any',
'profile_extra_any',
'profile_title_any',
));


Replace
$groupLevels['global']['maintenance'] = array_merge($groupLevels['global']['moderator'], array(
'manage_attachments',
'manage_smileys',
'manage_boards',
'moderate_forum',
'manage_membergroups',
'moderate_group',
'manage_bans',
'admin_forum',
'manage_permissions',
'edit_news',
'calendar_edit_any',
'profile_identity_any',
'profile_extra_any',
'profile_title_any',
));


Find
'manage_membergroups' => false,

Add after
'moderate_group' => false,

Sources/Profile.php
Find
'account' => array(array('manage_membergroups', 'profile_identity_any', 'profile_identity_own'), array('manage_membergroups', 'profile_identity_any')),

Replace
'account' => array(array('manage_membergroups', 'moderate_group', 'profile_identity_any', 'profile_identity_own'), array('manage_membergroups', 'moderate_group', 'profile_identity_any')),

Find
elseif ((allowedTo('profile_identity_own') && $context['user']['is_owner']) || allowedTo('profile_identity_any') || allowedTo('manage_membergroups'))

Replace
elseif ((allowedTo('profile_identity_own') && $context['user']['is_owner']) || allowedTo('profile_identity_any') || allowedTo('manage_membergroups') || allowedTo('moderate_group'))

Find
if (($context['user']['is_owner'] && (allowedTo(array('profile_identity_own', 'profile_extra_own')))) || allowedTo(array('profile_identity_any', 'profile_extra_any', 'manage_membergroups')))

Replace
if (($context['user']['is_owner'] && (allowedTo(array('profile_identity_own', 'profile_extra_own')))) || allowedTo(array('profile_identity_any', 'profile_extra_any', 'manage_membergroups', 'moderate_group')))

Find
if (($context['user']['is_owner'] && allowedTo('profile_identity_own')) || allowedTo(array('profile_identity_any', 'manage_membergroups')))

Replace
if (($context['user']['is_owner'] && allowedTo('profile_identity_own')) || allowedTo(array('profile_identity_any', 'manage_membergroups', 'moderate_group')))

Find
'account' => array(array('manage_membergroups', 'profile_identity_any', 'profile_identity_own'), array('manage_membergroups', 'profile_identity_any'), 'post', true),

Replace
'account' => array(array('manage_membergroups', 'profile_identity_any', 'profile_identity_own', 'moderate_group'), array('manage_membergroups', 'profile_identity_any', 'moderate_group'), 'post', true),

Find
if (allowedTo('manage_membergroups'))

Replace
if (allowedTo(array('manage_membergroups', 'moderate_group')))

Find
$context['allow_edit_membergroups'] = allowedTo('manage_membergroups');

Replace
$context['allow_edit_membergroups'] = allowedTo('manage_membergroups') || allowedTo('moderate_group');

Find
$curGroups = explode(',', $user_profile[$memID]['additionalGroups']);

Add After
$ownGroups = explode(',', $context['member']['additionalGroups']);

Find
if ($row['ID_GROUP'] == 1 && !allowedTo('admin_forum'))

Replace
if (($row['ID_GROUP'] == 1 && !allowedTo('admin_forum')) || ($row['ID_GROUP'] != $context['user']['ID_GROUP'] && !strpos($ownGroups, $row['ID_GROUP']) && !allowedTo('manage_membergroups)))

Find
if (allowedTo('manage_membergroups') && isset($_POST['ID_GROUP']))

Replace
if ((allowedTo('manage_membergroups') || allowedTo('moderate_group')) && isset($_POST['ID_GROUP']))

Themes/default/languages/Modifications.english.php

Find
?>

Add before that
$txt['permissionname_moderate_group'] = 'Moderate own membergroup(s)';
$txt['permissionhelp_moderate_group'] = 'This allows a member to become "moderator" of the membergroup(s) they belong to, with the power to add members to the group(s) and delete members from the group(s).';


I'll try to release this as a mod soon.
Michael Eshom
Christian Metal Fans

mennou

you should  lol..  it will be helpful   .... :P when u might  release it...

codenaught

Yeah it would be great if you release that as a mod.  ;)
Dev Consultant
Former SMF Doc Coordinator

Amacythe

GREAT JOB! Oldiesmann.  This is a great addition to the mods already available. :)

Ruth

I'm uh... a little stupid when it comes to editing such things. I usually break the board when I try... so... I'll wait to see if one of those nifty easy-to-install mod thingies comes out ;)

Thanks for doing all that work though! I KNOW I'll use it, once I find someone who can edit the board and such.

Lazarus

Absolutely a great idea.  I too will be awaiting such a mod.

I am the CEO of a player corporation in an MMO called "hxxp:www.eve-online.com [nonactive]", and we have set up a community site for all of the corporations residing in our region of space.  At the moment, we have a few admins allowing individual members, but as most of these members are from other organizations, verification can be a pain.

It'd be far easier for us if we can create a membergroup for each corporation, and assign a couple mods for each, and allow each corporation to grant access to their own corpmates (someone who ran the last such board used phpBB, where that worked well).

One problem I would have with the current arrangement would be that each of these corporations have leaders (CEO and directors) who would also be placed in a leadership membergroup...  but we would not want moderators of the individual corporation membergroups to be able to add/remove members from the leadership membergroup.

Would it be too difficult to allow group moderation for individual groups, rather than allowing individual members to moderate all groups they are members of?

If not however, I've got a way around it.

Ruth

Oops, that's what I thought I'd asked for.

I don't want someone to be able to add members to both the calgary AB group AND the vancouver BC group. I want to say that "Susie" can add and remove people from Calgary, and "Carol" can add and remove people from Vancouver. And as always you wouldn't want these same people to grant the ability to another person of adding and removing others. So "Susie" can add "Bob" to her group, but can't make Bob have the ability to add and remove people from that group.

Oldiesmann

Ruth - this is only meant to work with Grudge's Member Specific Permissions mod at the moment. Otherwise you end up giving everyone in a particular group the ability to add and remove other members from the group, which kinda defeats the purpose of this mod. Shortly after I did this, I thought of a better way to do it, and will work on playing with that method when I get some more time. If you only want people to be able to add and remove other members from their primary group and not their secondary ("additional") groups, then change this line in Profile.php:

Find
  if (($row['ID_GROUP'] == 1 && !allowedTo('admin_forum')) || ($row['ID_GROUP'] != $context['user']['ID_GROUP'] && !strpos($ownGroups, $row['ID_GROUP']) && !allowedTo('manage_membergroups)))

Replace
  if (($row['ID_GROUP'] == 1 && !allowedTo('admin_forum')) || ($row['ID_GROUP'] != $context['user']['ID_GROUP'] && !allowedTo('manage_membergroups)))
Michael Eshom
Christian Metal Fans

Ruth

That's okay, I'll just wait for a mod lol.
The clients that want this can't afford to pay me to edit the base code. ;)

I just want to be clear that we both "get" what it is I'm asking for.

Julie and Courtney are the moderators for the Vancouver group on d20 Chyx. They are in a group called "Regional Moderator" so that I can give them access to a private board for discussion on the moderator level. They are also both in a group called "Vancouver BC" which has about 20 other women in it. I want Julie and Courtney to be able to add and remove people from "Vancouver BC", but only Julie and Courtney and only the group "Vancouver BC".

The reason being is because Lyn and Carolyn are the moderators for the Calgary AB group on d20 Chyx. They are also set up as "Regional Moderators" so they can see the private moderators board and I need for both of them to be able to add and remove people from "Calgary AB" and no other group.

I know you guys have posted a lot of code, but I can't read that and understand what's been done. I'm not very code friendly unfortunately.

On another board I have literally over 40 little groups. It's a game board and anyone can request a private board for their gaming group. They post game times, XP, character backgrounds etc. I want the moderator of those boards to be able to add/remove people *from that group only* but just that moderator... not the others.

It's the same situation whereever you go. I want one or two people to be able to add/remove people from one particular group and no others.

I hope you do decide to make a mod :) but life comes first!

Ruth

Thanks for the help... I'm still hoping to see a mod since I'm pretty hopeless with code.

*wink wink nudge nudge*

ToyDozer

#17
Parse error: parse error in /blah/home/blah/public_html/Board/Sources/Profile.php on line 1287

Fatal error: Call to undefined function: account() in /blah/home/blah/public_html/Board/Sources/Profile.php on line 203


That just cant be good?? I get it when I go to "Account Related Settings" in the profile manager. Any advice??

Line 1287 from my Profile.php
$context['member_groups'][$row['ID_GROUP']] = array
Bigger chunk surrounding line 1287
// We should skip the administrator group if they don't have the admin_forum permission!
    if (($row['ID_GROUP'] == 1 && !allowedTo('admin_forum')) || ($row['ID_GROUP'] != $context['user']['ID_GROUP'] && !allowedTo('manage_membergroups)))
  continue;

$context['member_groups'][$row['ID_GROUP']] = array
'id' => $row['ID_GROUP'],
'name' => $row['groupName'],
'is_primary' => $user_profile[$memID]['ID_GROUP'] == $row['ID_GROUP'],
'is_additional' => in_array($row['ID_GROUP'], $curGroups),
'can_be_additional' => true,
);
}


Line 203 from my Profile.php
$_REQUEST['sa']($memID);
Bigger chunk surrounding line 203
// Call the appropriate subaction function.
$_REQUEST['sa']($memID);

if (!empty($post_errors))
{
// Set all the errors so the template knows what went wrong.
foreach ($post_errors as $error_type)
$context['modify_error'][$error_type] = true;
rememberPostData();
}

// Set the page title if it's not already set...
if (!isset($context['page_title']))
$context['page_title'] = $txt[79] . ' - ' . $txt[$_REQUEST['sa']];
}
Jon Stensaa
www.wheelingadventures.com [nofollow]
[email protected]
Accelerator : The stomped out hole in the floarboard!!!!

Dannii

Try my mod instead: http://mods.simplemachines.org/index.php?mod=171
It will install in 1.0.5, 1.1b3 and 1.1RC1
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

ToyDozer

Quote from: eldacar on December 23, 2005, 11:30:09 PM
Try my mod instead: http://mods.simplemachines.org/index.php?mod=171
It will install in 1.0.5, 1.1b3 and 1.1RC1

Ahh very very nice, up and running no trouble at all! Thanks!!
Jon Stensaa
www.wheelingadventures.com [nofollow]
[email protected]
Accelerator : The stomped out hole in the floarboard!!!!

Advertisement: