"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/report.php" between
mybb_1821.zip and mybb_1822.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

report.php  (mybb_1821):report.php  (mybb_1822)
skipping to change at line 77 skipping to change at line 77
// Check for a valid forum // Check for a valid forum
$forum = get_forum($post['fid']); $forum = get_forum($post['fid']);
if(!isset($forum['fid'])) if(!isset($forum['fid']))
{ {
$error = $lang->sprintf($lang->error_invalid_report, $rep ort_type); $error = $lang->sprintf($lang->error_invalid_report, $rep ort_type);
} }
else else
{ {
$verified = true; $verified = true;
$button = '#post_'.$id.' .postbit_report';
} }
// Password protected forums ......... yhummmmy! // Password protected forums ......... yhummmmy!
$id3 = $forum['fid']; $id3 = $forum['fid'];
check_forum_password($forum['parentlist']); check_forum_password($forum['parentlist']);
} }
} }
else if($report_type == 'profile') else if($report_type == 'profile')
{ {
$user = get_user($mybb->get_input('pid', MyBB::INPUT_INT)); $user = get_user($mybb->get_input('pid', MyBB::INPUT_INT));
skipping to change at line 98 skipping to change at line 99
if(!isset($user['uid'])) if(!isset($user['uid']))
{ {
$error = $lang->sprintf($lang->error_invalid_report, $report_type ); $error = $lang->sprintf($lang->error_invalid_report, $report_type );
} }
else else
{ {
$verified = true; $verified = true;
$report_type_db = "type = 'profile'"; $report_type_db = "type = 'profile'";
$id2 = $id3 = 0; // We don't use these on the profile $id2 = $id3 = 0; // We don't use these on the profile
$id = $checkid = $user['uid']; // id is the profile user $id = $checkid = $user['uid']; // id is the profile user
$button = '.report_user_button';
} }
} }
else if($report_type == 'reputation') else if($report_type == 'reputation')
{ {
// Any member can report a reputation comment but let's make sure it exis ts first // Any member can report a reputation comment but let's make sure it exis ts first
$query = $db->simple_select("reputation", "*", "rid = '".$mybb->get_input ('pid', MyBB::INPUT_INT)."'"); $query = $db->simple_select("reputation", "*", "rid = '".$mybb->get_input ('pid', MyBB::INPUT_INT)."'");
if(!$db->num_rows($query)) if(!$db->num_rows($query))
{ {
$error = $lang->sprintf($lang->error_invalid_report, $report_type ); $error = $lang->sprintf($lang->error_invalid_report, $report_type );
} }
else else
{ {
$verified = true; $verified = true;
$reputation = $db->fetch_array($query); $reputation = $db->fetch_array($query);
$id = $reputation['rid']; // id is the reputation id $id = $reputation['rid']; // id is the reputation id
$id2 = $checkid = $reputation['adduid']; // id2 is the user who g ave the comment $id2 = $checkid = $reputation['adduid']; // id2 is the user who g ave the comment
$id3 = $reputation['uid']; // id3 is the user who received the co mment $id3 = $reputation['uid']; // id3 is the user who received the co mment
$report_type_db = "type = 'reputation'"; $report_type_db = "type = 'reputation'";
$button = '#rid'.$id.' .postbit_report';
} }
} }
$plugins->run_hooks("report_type");
$permissions = user_permissions($checkid); $permissions = user_permissions($checkid);
if(empty($permissions['canbereported'])) if(empty($permissions['canbereported']))
{ {
$error = $lang->sprintf($lang->error_invalid_report, $report_type); $error = $lang->sprintf($lang->error_invalid_report, $report_type);
} }
$plugins->run_hooks("report_type");
// Check for an existing report // Check for an existing report
if(!empty($report_type_db)) if(!empty($report_type_db))
{ {
$query = $db->simple_select("reportedcontent", "*", "reportstatus != '1' AND id = '{$id}' AND {$report_type_db}"); $query = $db->simple_select("reportedcontent", "*", "reportstatus != '1' AND id = '{$id}' AND {$report_type_db}");
if($db->num_rows($query)) if($db->num_rows($query))
{ {
// Existing report // Existing report
$report = $db->fetch_array($query); $report = $db->fetch_array($query);
$report['reporters'] = my_unserialize($report['reporters']); $report['reporters'] = my_unserialize($report['reporters']);
skipping to change at line 165 skipping to change at line 168
if(!empty($report)) if(!empty($report))
{ {
// Existing report, add vote // Existing report, add vote
$report['reporters'][] = $mybb->user['uid']; $report['reporters'][] = $mybb->user['uid'];
update_report($report); update_report($report);
$plugins->run_hooks("report_do_report_end"); $plugins->run_hooks("report_do_report_end");
eval("\$report_thanks = \"".$templates->get("report_thanks")."\"; "); eval("\$report_thanks = \"".$templates->get("report_thanks")."\"; ");
echo $report_thanks; echo $report_thanks;
echo sprintf("<script type='text/javascript'>$('%s').remove();</s cript>", $button);
exit; exit;
} }
else else
{ {
// Bad user! // Bad user!
$new_report = array( $new_report = array(
'id' => $id, 'id' => $id,
'id2' => $id2, 'id2' => $id2,
'id3' => $id3, 'id3' => $id3,
'uid' => $mybb->user['uid'] 'uid' => $mybb->user['uid']
skipping to change at line 223 skipping to change at line 227
} }
if(empty($error)) if(empty($error))
{ {
add_report($new_report, $report_type); add_report($new_report, $report_type);
$plugins->run_hooks("report_do_report_end"); $plugins->run_hooks("report_do_report_end");
eval("\$report_thanks = \"".$templates->get("report_thank s")."\";"); eval("\$report_thanks = \"".$templates->get("report_thank s")."\";");
echo $report_thanks; echo $report_thanks;
echo sprintf("<script type='text/javascript'>$('%s').remo ve();</script>", $button);
exit; exit;
} }
} }
} }
if(!empty($error) || $verified == false) if(!empty($error) || $verified == false)
{ {
$mybb->input['action'] = ''; $mybb->input['action'] = '';
if($verified == false && empty($error)) if($verified == false && empty($error))
 End of changes. 7 change blocks. 
2 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)