Description - Allows administrator to set permissions for selected moderators to add and optionally remove users from selected groups. Adds links to new pages for admin and mods in admin menu.
Example - None.
Pre-requisites - none
Author - Aglavalin, aka Steve Stout
Files Altered - admin/menu.php
Database Altered - Only a new table is created, thus, very removable.
New Files - admin/pickuser.php, admin/editusergroup.php, admin/doeditusergroup.php, admin/editgroupmod.php and admin/doeditgroupmod.php
Credits: I have seen this asked for several times on the ubbdev.com boards.
Notes: This is a simple hack. Group Moderators need to be in the UBBT moderator group to access the pages via admin menu, but they do not need to be a board moderator. The ability to remove a user from each group a moderator can add users to is optional. i.e A moderator can add a user to a group, but not remove anyone from that group if the admin desires. Works fine on 6.1
This seems to be working fine so far, so I'm gonna release it. It is beta, and will probably evolve some before being finished. I have added in as many security checks as I can think of, but if anyone can find any loopholes please let me know!
Here is my situation. My site is just a massive general regional site. And within my site there are many official "clubs", and they have been bugging me to host their message boards within my current board system, and obviously make them private to only group members.
So, that is great, but I had to wait for a PM from the club owner with a list of names to add to that usergroup. So, are you saying I make the private forums, and setup the mod for those forums only. I can then grant them privilages to add anyone to only THEIR usergroup?
If that is how I understand it, that is an incredible and essential mod for me, as I do not have time/energy to do this for them.
Yes, you can make a group just for one forum, or category, and assign as many people as you like to add and/or delete users from that group. I have this issue on my boards, where I have at least 5 groups that I get PMs on to add people almost every day, so I got tired of it and now I have assigned one person from each group to just do it themself! I also use these groups to allow access to sections of the website, so now the new users can gain access faster since I don't have to be in the loop anymore
Very nice mod indeed, this will certainly make it easier for the admin when there are many sub-boards that new users have to be added to on a regular basis. I've had a few of these myself, but the only one that is active at the moment aren't adding any new members anymore. But if any of the boards gets active and wants to have more members I will definitely install this.
I just had a bad thought about this. I need to add the ability for it to prevent someone from editing the groups of admins and moderators. I'll come up with a new version which has a couple more options for the admin to check off groups which will prevent their members from having ANY of their groups modified. This should take care of this issue. This would only be some page replacements, and would only matter in rare cases. This hack is still safe as long as you don't give the authority to boneheads or someone who is in a foul mood. LOL
code:CREATE TABLE w3t_Groupmods ( GM_Username varchar(30) NOT NULL, GM_AddGroup tinyint(3) DEFAULT '3' NOT NULL, GM_RemoveGroup carchar(1) NOT NULL, KEY GM_Username (GM_Username) );
I know in the instructions it says it will give an error but the table will be created correctly. But.. I checked, the table was not created. It gave this as a response:
[]You have an error in your SQL syntax near 'carchar(1) NOT NULL, KEY GM_Username (GM_Username) )' at line 4 [/]
Hmm, just got around to actually putting this hack into action, and encountering a problem when trying to add someone:
[]SQL ERROR: Database error only visible to forum administrators
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/www/michiganjeepers/forums/mysql.inc.php on line 121 [/]
Every other feature works, except that one. And also.. why do the group mods have ability to ban users? That may not be too safe if it is a public ban, or is it just a ban from their forum?
Not sure if this was the intended use or not, but moderators, whether or not they are group mods have access to the "admin" link, and they can edit the forum they are a mod in!! I don't want that feature.. could be potentially very dangerous
The mods have had that ability for a while, there is a hack for it around here. One that you can turn off some of their abilities, like editing the forum!
Really? I have just recently started adding mods, but I had no idea they had these abilities! I just don't like the idea of a mod getting ticked off and purging all of the threads in their forum, or banning people for no reason, etc. I mean I trust them as mods, but not with some admin functions.
I will have to look to see if I can find that hack you are talking about.
Also, I am still getting that error when trying to add someone to a group, so if you have time and could look at that, that would be great Thanks.
I'm using it under 6.1. When I upgrade UBB.threads, though, I use Beyond Compare, rather than re-installing hacks individually.
I think the only change needed is to use {$config['tbprefix']}Users instead of w3t_Users, in the changes to admin/showstats.php. And that really only matters if you're using, or may be using in the future, a custom table prefix other than "w3t_".
Aglavalin, any idea on what might be causing the SQL permissions errors? I'm sure its something simple, but I have retraced my steps and can't see an obvious problem
I really have no idea what the error could be. Try commenting out mysql.inc.php where it hides the error, then you can see what the error really is. This should shed some more light on it.
been very busy, but I figured out the problem. Just a small typo in your pickuser.php
code:// ----------------------------------------------- // check to see if they are a group moderator $query = " SELECT GM_Username FROM {$config['tbprefix']}groupmods WHERE GM_Username = '$Username' ";
Hmm I got it so it adds the moderator to the group with the different powers. But when I log in as the new moderator they don't have the power..... I also added the restrict moderator mod while installing this one. Any ideas why my new group moderator has no power?
Ok found what I needed... I had to give them mod powers to the specific forum. Somehow lost my add group moderators in the process. (*Then with mod powers they could read all the previously private mod forums) Yikes..
also had to adjust my previously private forums to admin/private usergroup acess so the "new group mods"... couldn't read what the actual mods (now a privatemod usergroup).
Works like a charm... very creative and should be very useful for private groups/clubs. Thanks
BTW I had to add a bit of code msula posted in the restrict moderators mod.
Well I almost got this...(I thought) I setup a test group moderator and when he adds a user to the group. The user gets removed from (users group), but placed in the private usergroup. Then the only forum the user added gets to view is the private one they just got added to, unless I go search the name and readd them to the user group. Kinda defeats the purpose of the mod if I have to fix every added user.
HELP>>> thanks in advance...
using 6.2.2 but shouldn't be a issue... will review the hack piece by piece when I get a chance to make sure I followed along correctly. Looks ok just a permission step in here someplace... doeditusergroup.php?
The usergroup the group moderator removes the user from never shows up on the list to be checked or unchecked. Like a default uncheck command is being used as it updates the user behinds the scenes. Need to limit the moderator from using that kind of power.
I got about every hack offered here going so it should be just a switch on a restriction.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.