Beispiel #1
0
	print_output($templater->render());
}

if ($_POST['do'] == 'sendemail')
{
	$vbulletin->input->clean_array_gpc('p', array(
		'reason' => TYPE_STR,
	));

	if ($vbulletin->GPC['reason'] == '')
	{
		eval(standard_error(fetch_error('noreason')));
	}

	if ($perform_floodcheck)
	{
		$reportobj->perform_floodcheck_commit();
	}

	$reportobj->do_report($vbulletin->GPC['reason'], $postinfo);

	eval(print_standard_redirect('redirect_reportthanks'));
}

/*======================================================================*\
|| ####################################################################
|| # 
|| # CVS: $RCSfile$ - $Revision: 32878 $
|| ####################################################################
\*======================================================================*/
?>
Beispiel #2
0
function do_report()
{
    global $vbulletin, $postinfo, $threadinfo, $foruminfo;
    if (!$vbulletin->userinfo['userid']) {
        json_error(ERR_NO_PERMISSION);
    }
    $reportthread = ($rpforumid = $vbulletin->options['rpforumid'] and $rpforuminfo = fetch_foruminfo($rpforumid));
    $reportemail = ($vbulletin->options['enableemail'] and $vbulletin->options['rpemail']);
    if (!$reportthread and !$reportemail) {
        standard_error(fetch_error('emaildisabled'));
    }
    $reportobj = new vB_ReportItem_Post($vbulletin);
    $reportobj->set_extrainfo('forum', $foruminfo);
    $reportobj->set_extrainfo('thread', $threadinfo);
    $perform_floodcheck = $reportobj->need_floodcheck();
    if ($perform_floodcheck) {
        $reportobj->perform_floodcheck_precommit();
    }
    $forumperms = fetch_permissions($threadinfo['forumid']);
    if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) or $threadinfo['postuserid'] != $vbulletin->userinfo['userid'] and !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers'])) {
        json_error(ERR_NO_PERMISSION);
    }
    if (!$postinfo['postid']) {
        standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink']));
    }
    if ((!$postinfo['visible'] or $postinfo['isdeleted']) and !can_moderate($threadinfo['forumid'])) {
        standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink']));
    }
    if ((!$threadinfo['visible'] or $threadinfo['isdeleted']) and !can_moderate($threadinfo['forumid'])) {
        standard_error(fetch_error('invalidid', $vbphrase['thread'], $vbulletin->options['contactuslink']));
    }
    // check if there is a forum password and if so, ensure the user has it set
    verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
    ($hook = vBulletinHook::fetch_hook('report_start')) ? eval($hook) : false;
    $vbulletin->input->clean_array_gpc('p', array('reason' => TYPE_STR));
    if ($vbulletin->GPC['reason'] == '') {
        standard_error(fetch_error('noreason'));
    }
    if ($perform_floodcheck) {
        $reportobj->perform_floodcheck_commit();
    }
    $reportobj->do_report(prepare_remote_utf8_string($vbulletin->GPC['reason']), $postinfo);
    return array('success' => true);
}
 public function report_item($reason)
 {
     require_once DIR . '/includes/class_reportitem.php';
     $threadinfo = verify_id('thread', $this->item['threadid'], 0, 1);
     $foruminfo = fetch_foruminfo($threadinfo['forumid']);
     $reportobj = new vB_ReportItem_Post($this->registry);
     $reportobj->set_extrainfo('forum', $foruminfo);
     $reportobj->set_extrainfo('thread', $threadinfo);
     $reportobj->do_report($reason, $this->item);
 }