Vergleich warnings.php - 1.8.2 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 49Zeile 49
		error_no_permission();
}


		error_no_permission();
}


	$user = get_user($mybb->get_input('uid', 1));

	$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));


if(!$user['uid'])
{


if(!$user['uid'])
{

Zeile 71Zeile 71
	$plugins->run_hooks("warnings_do_warn_start");

$warning = array(

	$plugins->run_hooks("warnings_do_warn_start");

$warning = array(

		'uid' => $mybb->get_input('uid', 1),

		'uid' => $mybb->get_input('uid', MyBB::INPUT_INT),

		'notes' => $mybb->get_input('notes'),
'type' => $mybb->get_input('type'),
'custom_reason' => $mybb->get_input('custom_reason'),

		'notes' => $mybb->get_input('notes'),
'type' => $mybb->get_input('type'),
'custom_reason' => $mybb->get_input('custom_reason'),

		'custom_points' => $mybb->get_input('custom_points', 1),
'expires' => $mybb->get_input('expires', 1),

		'custom_points' => $mybb->get_input('custom_points', MyBB::INPUT_INT),
'expires' => $mybb->get_input('expires', MyBB::INPUT_INT),

		'expires_period' => $mybb->get_input('expires_period')
);

// Is this warning being given for a post?

		'expires_period' => $mybb->get_input('expires_period')
);

// Is this warning being given for a post?

	if($mybb->get_input('pid', 1))

	if($mybb->get_input('pid', MyBB::INPUT_INT))

	{

	{

		$warning['pid'] = $mybb->get_input('pid', 1);

		$warning['pid'] = $mybb->get_input('pid', MyBB::INPUT_INT);


$post = get_post($warning['pid']);



$post = get_post($warning['pid']);


Zeile 102Zeile 102
		$warninginfo = $warningshandler->insert_warning();

// Are we notifying the user?

		$warninginfo = $warningshandler->insert_warning();

// Are we notifying the user?

		if($mybb->get_input('send_pm', 1) == 1 && $group_permissions['canusepms'] != 0 && $mybb->settings['enablepms'] != 0)

		if($mybb->get_input('send_pm', MyBB::INPUT_INT) == 1 && $group_permissions['canusepms'] != 0 && $mybb->settings['enablepms'] != 0)

		{

$pm = array(

		{

$pm = array(

Zeile 112Zeile 112
			);

$sender_uid = $mybb->user['uid'];

			);

$sender_uid = $mybb->user['uid'];

			if($mybb->settings['allowanonwarningpms'] == 1 && $mybb->get_input('pm_anonymous', 1))

			if($mybb->settings['allowanonwarningpms'] == 1 && $mybb->get_input('pm_anonymous', MyBB::INPUT_INT))

			{
$sender_uid = -1;
}

			{
$sender_uid = -1;
}

Zeile 161Zeile 161
		$given_today = $db->fetch_field($query, "given_today");
if($given_today >= $mybb->usergroup['maxwarningsday'])
{

		$given_today = $db->fetch_field($query, "given_today");
if($given_today >= $mybb->usergroup['maxwarningsday'])
{

			error($lang->sprintf($lang->reached_max_warnings_day, $mybb->usergroup['maxwarningsday']));

			error($lang->sprintf($lang->warnings_reached_max_warnings_day, $mybb->usergroup['maxwarningsday']));

		}
}


		}
}


	$user = get_user($mybb->get_input('uid', 1));

	$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));

	if(!$user)
{
error($lang->error_invalid_user);

	if(!$user)
{
error($lang->error_invalid_user);

Zeile 173Zeile 173

if($user['uid'] == $mybb->user['uid'])
{


if($user['uid'] == $mybb->user['uid'])
{

		error($lang->cannot_warn_self);

		error($lang->warnings_error_cannot_warn_self);

	}

if($user['warningpoints'] >= $mybb->settings['maxwarningpoints'])
{

	}

if($user['warningpoints'] >= $mybb->settings['maxwarningpoints'])
{

		error($lang->user_reached_max_warning);

		error($lang->warnings_error_user_reached_max_warning);

	}

$group_permissions = user_permissions($user['uid']);

	}

$group_permissions = user_permissions($user['uid']);

Zeile 196Zeile 196
	$post = $existing_warnings = '';

// Giving a warning for a specific post

	$post = $existing_warnings = '';

// Giving a warning for a specific post

	if($mybb->get_input('pid', 1))

	if($mybb->get_input('pid', MyBB::INPUT_INT))

	{

	{

		$post = get_post($mybb->get_input('pid', 1));

		$post = get_post($mybb->get_input('pid', MyBB::INPUT_INT));


if($post)
{


if($post)
{

Zeile 207Zeile 207

if(!$post || !$thread)
{


if(!$post || !$thread)
{

			error($lang->error_invalid_post);

			error($lang->warnings_error_invalid_post);

		}

$forum_permissions = forum_permissions($thread['fid']);

		}

$forum_permissions = forum_permissions($thread['fid']);

Zeile 227Zeile 227
			FROM ".TABLE_PREFIX."warnings w
LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (t.tid=w.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=w.issuedby)

			FROM ".TABLE_PREFIX."warnings w
LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (t.tid=w.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=w.issuedby)

			WHERE w.pid='".$mybb->get_input('pid', 1)."'

			WHERE w.pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'

			ORDER BY w.expired ASC, w.dateline DESC
");
$first = true;

			ORDER BY w.expired ASC, w.dateline DESC
");
$first = true;

Zeile 307Zeile 307
	if(!empty($warn_errors))
{
$notes = htmlspecialchars_uni($mybb->get_input('notes'));

	if(!empty($warn_errors))
{
$notes = htmlspecialchars_uni($mybb->get_input('notes'));

		if($mybb->get_input('type', 1))

		if($mybb->get_input('type', MyBB::INPUT_INT))

		{

		{

			$type_checked[$mybb->get_input('type', 1)] = "checked=\"checked\"";

			$type_checked[$mybb->get_input('type', MyBB::INPUT_INT)] = "checked=\"checked\"";

		}
$pm_subject = htmlspecialchars_uni($mybb->get_input('pm_subject'));
$message = htmlspecialchars_uni($mybb->get_input('pm_message'));

		}
$pm_subject = htmlspecialchars_uni($mybb->get_input('pm_subject'));
$message = htmlspecialchars_uni($mybb->get_input('pm_message'));

Zeile 318Zeile 318
			$send_pm_checked = "checked=\"checked\"";
}
$custom_reason = htmlspecialchars_uni($mybb->get_input('custom_reason'));

			$send_pm_checked = "checked=\"checked\"";
}
$custom_reason = htmlspecialchars_uni($mybb->get_input('custom_reason'));

		$custom_points = $mybb->get_input('custom_points', 1);
$expires = $mybb->get_input('expires', 1);
if($mybb->get_input('expires_period', 1))

		$custom_points = $mybb->get_input('custom_points', MyBB::INPUT_INT);
$expires = $mybb->get_input('expires', MyBB::INPUT_INT);
if($mybb->get_input('expires_period', MyBB::INPUT_INT))

		{

		{

			$expires_period[$mybb->get_input('expires_period', 1)] = "selected=\"selected\"";

			$expires_period[$mybb->get_input('expires_period', MyBB::INPUT_INT)] = "selected=\"selected\"";

		}
}
else

		}
}
else

Zeile 340Zeile 340
	add_breadcrumb($lang->nav_add_warning);

$user_link = build_profile_link($user['username'], $user['uid']);

	add_breadcrumb($lang->nav_add_warning);

$user_link = build_profile_link($user['username'], $user['uid']);

 

if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;
}

if(!is_array($groupscache))
{
$groupscache = $cache->read("usergroups");
}


$current_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);



$current_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);


Zeile 472Zeile 482
		if($mybb->settings['allowanonwarningpms'] == 1)
{
$checked = '';

		if($mybb->settings['allowanonwarningpms'] == 1)
{
$checked = '';

			if($mybb->get_input('pm_anonymous', 1))

			if($mybb->get_input('pm_anonymous', MyBB::INPUT_INT))

			{
$checked = ' checked="checked"';
}

			{
$checked = ' checked="checked"';
}

Zeile 488Zeile 498
	eval("\$warn = \"".$templates->get("warnings_warn")."\";");
output_page($warn);
exit;

	eval("\$warn = \"".$templates->get("warnings_warn")."\";");
output_page($warn);
exit;

}

}


// Revoke a warning
if($mybb->input['action'] == "do_revoke" && $mybb->request_method == "post")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


// Revoke a warning
if($mybb->input['action'] == "do_revoke" && $mybb->request_method == "post")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	if($mybb->usergroup['canwarnusers'] != 1)
{
error_no_permission();

	if($mybb->usergroup['canwarnusers'] != 1)
{
error_no_permission();

Zeile 513Zeile 523
	}

$user = get_user($warning['uid']);

	}

$user = get_user($warning['uid']);





	$group_permissions = user_permissions($user['uid']);
if($group_permissions['canreceivewarnings'] != 1)
{
error($lang->error_cant_warn_group);

	$group_permissions = user_permissions($user['uid']);
if($group_permissions['canreceivewarnings'] != 1)
{
error($lang->error_cant_warn_group);

	}


	}


	$plugins->run_hooks("warnings_do_revoke_start");

if(!trim($mybb->get_input('reason')))

	$plugins->run_hooks("warnings_do_revoke_start");

if(!trim($mybb->get_input('reason')))

Zeile 537Zeile 547
			'uid' => $warning['uid'],
'points' => $warning['points']
);

			'uid' => $warning['uid'],
'points' => $warning['points']
);





		$warningshandler->set_data($warning_data);

$warningshandler->update_warning();

		$warningshandler->set_data($warning_data);

$warningshandler->update_warning();

Zeile 560Zeile 570
		LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (t.tid=w.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=w.issuedby)
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=w.pid)

		LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (t.tid=w.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=w.issuedby)
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=w.pid)

		WHERE w.wid='".$mybb->get_input('wid', 1)."'

		WHERE w.wid='".$mybb->get_input('wid', MyBB::INPUT_INT)."'

	");
$warning = $db->fetch_array($query);


	");
$warning = $db->fetch_array($query);


Zeile 692Zeile 702
		error_no_permission();
}


		error_no_permission();
}


	$user = get_user($mybb->get_input('uid', 1));

	$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));

	if(!$user['uid'])
{
error($lang->error_invalid_user);

	if(!$user['uid'])
{
error($lang->error_invalid_user);

Zeile 715Zeile 725

// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['postsperpage'];


// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['postsperpage'];

	$page = $mybb->get_input('page', 1);

	$page = $mybb->get_input('page', MyBB::INPUT_INT);


$query = $db->simple_select("warnings", "COUNT(wid) AS warning_count", "uid='{$user['uid']}'");
$warning_count = $db->fetch_field($query, "warning_count");


$query = $db->simple_select("warnings", "COUNT(wid) AS warning_count", "uid='{$user['uid']}'");
$warning_count = $db->fetch_field($query, "warning_count");

Zeile 737Zeile 747
	}

$multipage = multipage($warning_count, $perpage, $page, "warnings.php?uid={$user['uid']}");

	}

$multipage = multipage($warning_count, $perpage, $page, "warnings.php?uid={$user['uid']}");

 

if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;
}


$warning_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);
if($warning_level > 100)


$warning_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);
if($warning_level > 100)