Previous Thread
Next Thread
Print Thread
Rate Thread
#224748 09/17/2002 2:48 PM
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Mod Name / Version - Group Moderators v1.0

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!
Attachments
56830-GroupModerators_v1.0.zip (0 Bytes, 25 downloads)

Sponsored Links
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
OH MY!!! Ok, let me get this straight.

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.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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

Last edited by Aglavalin; 09/17/2002 11:45 PM.
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
That is awesome. Best mod ever as far as I'm concerned, lol.

I will apply it later today. YOu just made my life a whole lot easier!

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Sponsored Links
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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

neuron #224754 09/20/2002 5:55 PM
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Here is an updated zip with a fix to block all admins and moderators from having any of their groups edited. Only editusergroups.php was changed.
Attachments
56975-GroupModerators_v1.1.zip (0 Bytes, 19 downloads)

Joined: Aug 2001
Posts: 128
Member
Member
Joined: Aug 2001
Posts: 128
Anyway we could get the add a user to a group to be like the search system built into UBBT??

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Hmm.. I got an error when running this query:
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
[/]

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Looks like another one of my typos there. That code should be

code:

CREATE TABLE w3t_Groupmods (
GM_Username varchar(30) NOT NULL,
GM_AddGroup tinyint(3) DEFAULT '3' NOT NULL,
GM_RemoveGroup varchar(1) NOT NULL,
KEY GM_Username (GM_Username)
);



Attached are correctied directions.
Attachments
57510-GroupModerators_v1.2.txt (0 Bytes, 63 downloads)

Sponsored Links
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Thanks, that worked

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
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?

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Ok... problem!

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

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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!

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
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.

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Restrict Moderators may be the hack you're looking for.

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Thanks Dave, yes that is what I was looking for. Any idea if it works under 6.1?

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
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_".

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Thanks, got it working great. Now.. if I could just get the SQL permissions error figured out, I'll be good to go

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
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

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Is that the error you posted here?

If so, you may need to comment-out the "admin-only" check in mysql.inc.php so that you can get the actual error message.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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.

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
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'
";



Where it says groupmods it should say Groupmods

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Would be nice if MySQL was case sensative on all servers so I would notice this kind of stuff, lol

Joined: Aug 2002
Posts: 45
User
User
Offline
Joined: Aug 2002
Posts: 45
Does anyone knows if it's compatible with 6.2 ?
I think it's very useful mod

Joined: Aug 2001
Posts: 128
Member
Member
Joined: Aug 2001
Posts: 128
So far it works with me....

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
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?

Running 6.2.2

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
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.

Thanks for a very powerful addition.

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
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.

Last edited by Smilesforu; 03/02/2003 3:48 AM.

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)