Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlisted "maxreputationsperuser" setting #2282

Closed
Destroy666x opened this issue Dec 3, 2015 · 1 comment
Closed

Unlisted "maxreputationsperuser" setting #2282

Destroy666x opened this issue Dec 3, 2015 · 1 comment
Assignees
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Milestone

Comments

@Destroy666x
Copy link
Contributor

The maxreputationsperuser setting can be changed when the corresponding POST value is added manually to the request updating group settings, but is not listed.

https://github.com/mybb/mybb/search?utf8...onsperuser

RE: http://community.mybb.com/thread-186824.html

Original thread: Unlisted "maxreputationsperuser" setting

@Destroy666x Destroy666x added t:bug Type: Bug. An issue causing error / flaw / malfunction s:confirmed Status: Confirmed. Retested and found the issue exists b:1.8 Branch: 1.8.x p:low Priority: Low. Issue to resolve with low preference labels Dec 3, 2015
@Destroy666x Destroy666x added this to the 1.8.7 milestone Dec 3, 2015
@Destroy666x
Copy link
Contributor Author

mybb/reputation.php

Lines 108 to 152 in c1c94f0

if($mybb->usergroup['maxreputationsday'] != 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete']))))
{
$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->simple_select("reputation", "*", "adduid='".$mybb->user['uid']."' AND dateline>'$timesearch'");
$numtoday = $db->num_rows($query);
// Reached the quota - error.
if($numtoday >= $mybb->usergroup['maxreputationsday'])
{
$message = $lang->add_maxperday;
if($mybb->input['nomodal'])
{
eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
}
else
{
eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
}
echo $error;
exit;
}
}
// Is the user giving too much reputation to another?
if($mybb->usergroup['maxreputationsperuser'] != 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete']))))
{
$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->simple_select("reputation", "*", "uid='".$uid."' AND dateline>'$timesearch'");
$numtoday = $db->num_rows($query);
if($numtoday >= $mybb->usergroup['maxreputationsperuser'])
{
$message = $lang->add_maxperuser;
if($mybb->input['nomodal'])
{
eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
}
else
{
eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
}
echo $error;
exit;
}
}

We're checking 2 group options with the same functionality for some reason... maxreputationsday is correct and listed in ACP, remainders of maxreputationsperuser should be removed.

Unless it's supposed to be max reputations per account (permamently, not just a day), then the code should be changed and the group option added to ACP. Who knows, it was partially added a long time ago. I'd personally go with this option rather than removing it.

EDIT: nvm, didn't notice another UID being used in the query for the first time, it's supposed to be "Maximum Receivable Reputations Per Day". And it should be added to:

  • usergroups.xml
  • ACP group edit
  • $groupzerogreater arrays

EDIT2: and the "You've already given this user as many reputation ratings as you can for today." error message is also wrong because it affects everybody, not just "you". It should be either changed or the query should also check adduid.

@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8.7, 1.8.8 Mar 2, 2016
@Starpaul20 Starpaul20 self-assigned this Mar 13, 2016
Destroy666x added a commit that referenced this issue Mar 28, 2016
Fixes #2282 Unlisted "maxreputationsperuser" setting
@Destroy666x Destroy666x added s:resolved Status: Resolved. Solution implemented or scheduled and removed p:low Priority: Low. Issue to resolve with low preference s:confirmed Status: Confirmed. Retested and found the issue exists labels Mar 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Projects
None yet
Development

No branches or pull requests

3 participants