MyBB Community Forums

Full Version: Prevent users from deleting reputation?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The purpose for my reputation will serve as a serious means of feedback for my forum and I can't allow the possibility of any ole' user just deleting feedback -- especially if a user gets a neg and he just deletes it.

Is there any way to prevent this, but still allow admins to have control?

I know I can remove the feature from a template, but that would mean I lost control also.

Ideally, I'd like to set this control as a usergroup permission.. maybe I am just overlooking something.

Thanks
Oh, additionally, is there a way to just Edit a reputation, instead of deleting it?
If you want to allow admins but disallow for non-admins, then it would need a plugin.
I suppose there is a work-around I can do..

I can remove the line, then revert if needed, then remove again.

Thx..
It would be better to use a plugin rather to remove and add again and again.
Ya, except I don't have a plugin lol.
try zingaburgas php in templates plugin? That way you can set what usergroups can view certain fields etc at template level.
Found another solution for this.

Reputation.php

(Line 352 & 353)
// Only administrators, super moderators, as well as users who gave a specifc vote can delete one.
if($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['issupermod'] != 1  && $existing_reputation['adduid'] != $mybb->user['uid'])

Replace with:

// Only administrators, super moderators, as well as users who gave a specifc vote can delete one.
if($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['issupermod'] != 1)

(Line 688 & 689)
// Does the current user have permission to delete this reputation? Show delete link
if($mybb->usergroup['cancp'] == 1 || $mybb->usergroup['issupermod'] == 1 || ($mybb->usergroup['cangivereputations'] == 1 && $reputation_vote['adduid'] == $mybb->user['uid'] && $mybb->user['uid'] != 0))

Replace with:

// Does the current user have permission to delete this reputation? Show delete link
if($mybb->usergroup['cancp'] == 1 || $mybb->usergroup['issupermod'] == 1)

This allows only Admins and Supermods to remove reputations.
Removing the 'Supermod' bit on those same lines would allow only Admins.

No plugin necessary.
Do this at your own risk...
Please correct ")" after the if () function; like these ;

(2010-12-19, 12:55 PM)atomicj Wrote: [ -> ]Replace with:

// Only administrators, super moderators, as well as users who gave a specifc vote can delete one.
if($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['issupermod'] != 1

(Line 688 & 689)
// Does the current user have permission to delete this reputation? Show delete link
if($mybb->usergroup['cancp'] == 1 || $mybb->usergroup['issupermod'] == 1 || ($mybb->usergroup['cangivereputations'] == 1 && $reputation_vote['adduid'] == $mybb->user['uid'] && $mybb->user['uid'] != 0))

Replace with:

// Does the current user have permission to delete this reputation? Show delete link
if($mybb->usergroup['cancp'] == 1 || $mybb->usergroup['issupermod'] == 1

This allows only Admins and Supermods to remove reputations.
Removing the 'Supermod' bit on those same lines would allow only Admins.

No plugin necessary.
Do this at your own risk...

It should be;
if($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['issupermod'] != 1)

on both instances.