Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
NAME: Restrict Moderators
VERSION: 1.0.4
DESCRIPTION: Globally enable/disable selected moderator privileges.
WORKING UNDER: UBB.threads 6.0.0 - 6.2
PREREQUISITES: none
AUTHOR: Dave_L
CREDITS: Lisa_P (for explaining how the privileges are checked, and for beta testing)
DEMO: none
FILES ALTERED: admin/banuser.php, admin/dobanuser.php, admin/doeditboard.php, admin/dounbanuser.php,
admin/editboard.php, admin/unbanuser.php, admin/showstats.php, admin/menu.php, config.inc.php
DATABASE ALTERED: no
NEW FILES: none

HISTORY:
2002-06-10 Dave_L - 1.0.0 Original release
2002-06-15 Dave_L - 1.0.1 Description updated (no code changes)
2002-07-07 Dave_L - 1.0.2 Description updated (no code changes)
2003-01-03 Dave_L - 1.0.3 Added $config['tbprefix'] for compatibility with 6.1 and 6.2.
2003-01-05 Dave_L - 1.0.4 Fixed typo.
Attachments
52055-restrict_moderators_1-0-4.zip (0 Bytes, 66 downloads)

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
You get to select individual moderators and grant permissions?


- Allen wavey
- What Drives You?
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
No, the permissions apply to all moderators. In the description, "selected" refers to selecting the privilege, not the moderator. Maybe that should be reworded.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
ok, makes sense

i am sure there are those out there who are new to running threads and have no idea what privileges moderators have on their boards


- Allen wavey
- What Drives You?
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Here's the extended description for the hack. If you think it's worthwhile, you could append the following to the original post above, and then delete this post.

********
ABSTRACT
********

The following configuration parameters are added:

mod_editforum - allow moderators to edit forums
mod_ban - allow moderators to ban a user or IP
mod_unban - allow moderators to unban a user or IP
mod_viewallstats - allow moderators to view stats for all forums, including those not readable by the moderator

To use these parameters, specify them in Admin/Edit config settings ("The following variables are unknown to the base UBB.threads package, but might be used by installed hacks or modifications to the program"). They can also be manually added by editing config.inc.php. A value of '1' enables the moderator privilege, a value of '0' disables the privilege. If a parameter is not specified, that's equivalent to specifying it as '0'.

Here is an example of specifying the parameters. In this example, moderators are denied the privileges of editing forums and viewing all stats, and are given the privileges of banning and unbanning users:

$config['mod_editforum'] = '0';
$config['mod_ban'] = '1';
$config['mod_unban'] = '1';
$config['mod_viewallstats'] = '0';

Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Yeah, I remember the first time a moderator asked if it was OK that he changed a user (after a request), I hadn't had a qlue that they could do that. And before that I was a bit confused when a moderator posted some stats from the forum, I didn't know that either. Back then I don't think I even knew they had an admin page at all, only that they had the post edit options. =] But I trust my moderators and already had a bunch of admins that I knew could do anything.

Maybe just a short description on the add mod privs-option telling what they will be able to do would be a good idea.

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
It owuld be nice to see the ability to NOT allow moderators to edit a user profile, but allow the moderator to add users to the groups they are members of only.


Silly ricer.. Wings are for airplanes!
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Good idea. I don't really have the time to work on that right now, but if someone else wants to figure out exactly what changes would be required, I could probably incorporate it into this hack.

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Working great, although I had to make some changes for it to work in conjunction with the group moderators, maybe you found a different way around it, but this is the code I used:

code:
// DAVE MOD BEGIN
// 2002-06-10 Dave Lerner
// Remove links for privileges that are denied to moderators.

if ($config['modedit'] or $config['mod_ban'] or $config['mod_unban']) {
$html -> open_admin_table();
echo <<<EOF
<tr><td valign=top class=tdheader>
<b>User Management</b>
</td></tr>
<tr><td valign=top class=lighttable width=30%>
EOF;
if ($config['modedit']) {
echo "<a href='{$config['phpurl']}/admin/selectusers.php?Cat=$Cat' target='mainFrame'>Show / Edit Users</a><br />";
}
if ($config['mod_ban']) {
echo "<a href='{$config['phpurl']}/admin/banuser.php?Cat=$Cat' target='mainFrame'>Ban a User / Host</a><br />";
}
if ($config['mod_unban']) {
echo "<a href='{$config['phpurl']}/admin/unbanuser.php?Cat=$Cat' target='mainFrame'>Unban User / IP</a>";
}
EOF;
$html -> close_table();
echo "<p>";
}


if ($config['mod_editforum']) {
$html -> open_admin_table();
echo <<<EOF
<tr><td valign=top class=tdheader>
<b>Forum Management</b>
</td></tr>
<tr><td valign=top class=lighttable>
<a href="{$config['phpurl']}/admin/editboard.php?Cat=$Cat" target="mainFrame">
Edit a forum
</a>
EOF;
$html -> close_table();
echo "<p>";
}
// Start Group Moderator Hack
$html -> open_admin_table();
echo <<<EOF
<tr><td valign=top class=tdheader>
<b>Group Management</b>
</td></tr>
<tr><td valign=top class=lighttable width=30%>
<a href="{$config['phpurl']}/admin/pickuser.php" target="mainFrame">
Add User to a Group
</a>
<br>
EOF;
$html -> close_table();
echo <<<EOF
<br>
EOF;
// End Group Moderator Hack

// DAVE MOD END


Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
(Note: the above changes are for admin/menu.php.)

Thanks. Personally, I'm not interested in the group moderators hack, but that may be useful to others.

admin/menu.php is a messy file to hack, isn't it?

Sponsored Links
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Yes, it took me about 20 minutes to get it to look right w/o errors.. but at least it works

Joined: Oct 1999
Posts: 282
Enthusiast
Enthusiast
Offline
Joined: Oct 1999
Posts: 282
Hello Dave,

looks like "Restrict Moderators" does not work properly with ubbt 6.2. A moderator can see all board-infos (Information / Forum info) even if he is not the moderator of them.

Any chance we see an update some time?

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
The only change needed that I could find was to replace

FROM [:"red"]w3t_[/]Users

with

FROM [:"red"]{$config['tbprefix']}[/]Users

in the changes to admin/showstats.php.

But that should only matter if you're not using "w3t_" as your table prefix, and even then, you should have gotten a MySQL error.




Joined: Oct 1999
Posts: 282
Enthusiast
Enthusiast
Offline
Joined: Oct 1999
Posts: 282
My fault, it still works. I thought the board info will only be shown when I'm moderator for these. But it shows the boards where I have got read-access. So, everything fine, sorry.

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768

Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
I have one questions to this hack cause
I am missing a feature.

My mods need to add people to groups and should be able to change their forum but they should not be allowed to edit user profiles.

If they access the admin menu they can add a user to a group editing their profiles but they can also see the users private emailaddress and thats nothing I and the other users really want I think.

So adding users to group or removing should be possible but no other change to the profile should be allowed for the mods.

How can I do so?

Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
[]It owuld be nice to see the ability to NOT allow moderators to edit a user profile, but allow the moderator to add users to the groups they are members of only. [/]

DAMN, thats exactly what I need. Has anyone implemented this, I need it urgently!

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Suggestions:

1) You could learn PHP and figure out how to do this yourself.

2) Post a request in the Developer for Hire forum. If you're willing to pay for this, you're more likely to get someone to do it for you.

Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
Do you had a bad day Dave
Never read such an answer from you before

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Those were intended to be practical, helpful suggestions.

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
How about this one.. Here

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
A bit late to the party but this could be what I am after for 6.3.x as I am finding my moderators, are likely to ban people on their forums a bit too easily


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

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
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
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)