Vergleich warnings.php - 1.8.35 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 52Zeile 52

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



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


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

	if(!$user)
{

		error($lang->error_invalid_user);

		error($lang->error_invalid_user);

	}


	}


	$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);

	}


	}


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

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

Zeile 83Zeile 83

// Is this warning being given for a post?
if($mybb->get_input('pid', MyBB::INPUT_INT))


// Is this warning being given for a post?
if($mybb->get_input('pid', MyBB::INPUT_INT))

	{

	{

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

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





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

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





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

if($forum_permissions['canview'] != 1)
{
error_no_permission();

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

if($forum_permissions['canview'] != 1)
{
error_no_permission();

		}

		}

	}

	}





	$warningshandler->set_data($warning);

if($warningshandler->validate_warning())

	$warningshandler->set_data($warning);

if($warningshandler->validate_warning())

Zeile 104Zeile 104

// Are we notifying the user?
if($mybb->get_input('send_pm', MyBB::INPUT_INT) == 1 && $group_permissions['canusepms'] != 0 && $mybb->settings['enablepms'] != 0)


// Are we notifying the user?
if($mybb->get_input('send_pm', MyBB::INPUT_INT) == 1 && $group_permissions['canusepms'] != 0 && $mybb->settings['enablepms'] != 0)

		{

		{


$pm = array(
'subject' => $mybb->get_input('pm_subject'),


$pm = array(
'subject' => $mybb->get_input('pm_subject'),

Zeile 114Zeile 114

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


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

			{

			{

				$sender_uid = -1;
// Workaround for eliminating PHP warnings in PHP 8. Ref: https://github.com/mybb/mybb/issues/4630#issuecomment-1369144163
$pm['sender']['uid'] = -1;

				$sender_uid = -1;
// Workaround for eliminating PHP warnings in PHP 8. Ref: https://github.com/mybb/mybb/issues/4630#issuecomment-1369144163
$pm['sender']['uid'] = -1;

Zeile 134Zeile 134
		if(!empty($post['pid']))
{
redirect(get_post_link($post['pid']), $lang->redirect_warned);

		if(!empty($post['pid']))
{
redirect(get_post_link($post['pid']), $lang->redirect_warned);

		}

		}

		else
{
redirect(get_profile_link($user['uid']), $lang->redirect_warned);

		else
{
redirect(get_profile_link($user['uid']), $lang->redirect_warned);

Zeile 297Zeile 297
		if($warnings)
{
eval("\$existing_warnings = \"".$templates->get("warnings_warn_existing")."\";");

		if($warnings)
{
eval("\$existing_warnings = \"".$templates->get("warnings_warn_existing")."\";");

		}
}

		}
}


$plugins->run_hooks("warnings_warn_start");


$plugins->run_hooks("warnings_warn_start");





	$type_checked = array('custom' => '');
$expires_period = array('hours' => '', 'days' => '', 'weeks' => '', 'months' => '', 'never' => '');
$send_pm_checked = '';

	$type_checked = array('custom' => '');
$expires_period = array('hours' => '', 'days' => '', 'weeks' => '', 'months' => '', 'never' => '');
$send_pm_checked = '';

Zeile 309Zeile 309
	// Coming here from failed do_warn?
$user['username'] = htmlspecialchars_uni($user['username']);
if(!empty($warn_errors))

	// Coming here from failed do_warn?
$user['username'] = htmlspecialchars_uni($user['username']);
if(!empty($warn_errors))

	{

	{

		$notes = htmlspecialchars_uni($mybb->get_input('notes'));
if($mybb->get_input('type', MyBB::INPUT_INT))
{

		$notes = htmlspecialchars_uni($mybb->get_input('notes'));
if($mybb->get_input('type', MyBB::INPUT_INT))
{

Zeile 380Zeile 380
				$level['friendly_action'] = $lang->sprintf($lang->result_banned, $group_name, $period);
break;
case 2:

				$level['friendly_action'] = $lang->sprintf($lang->result_banned, $group_name, $period);
break;
case 2:

				if($level['action']['length'] > 0)

				if($level['action']['length'] > 0)

				{
$period = fetch_friendly_expiration($level['action']['length']);
$lang_str = "expiration_".$period['period'];
$period = $lang->sprintf($lang->result_period, $period['time'], $lang->$lang_str);

				{
$period = fetch_friendly_expiration($level['action']['length']);
$lang_str = "expiration_".$period['period'];
$period = $lang->sprintf($lang->result_period, $period['time'], $lang->$lang_str);

				}

				}

				else
{
$period = $lang->result_period_perm;
}
$level['friendly_action'] = $lang->sprintf($lang->result_suspended, $period);

				else
{
$period = $lang->result_period_perm;
}
$level['friendly_action'] = $lang->sprintf($lang->result_suspended, $period);

				break;

				break;

			case 3:
if($level['action']['length'] > 0)
{

			case 3:
if($level['action']['length'] > 0)
{

Zeile 411Zeile 411
	krsort($levels);

$types = '';

	krsort($levels);

$types = '';





	// Fetch all current warning types
$query = $db->simple_select("warningtypes", "*", "", array("order_by" => "title"));
while($type = $db->fetch_array($query))

	// Fetch all current warning types
$query = $db->simple_select("warningtypes", "*", "", array("order_by" => "title"));
while($type = $db->fetch_array($query))

Zeile 432Zeile 432
			$type['points'] = "+{$type['points']}";
}
$points = $lang->sprintf($lang->warning_points, $type['points']);

			$type['points'] = "+{$type['points']}";
}
$points = $lang->sprintf($lang->warning_points, $type['points']);





		if(is_array($levels))
{
foreach($levels as $level)

		if(is_array($levels))
{
foreach($levels as $level)

Zeile 462Zeile 462
		if(empty($types) && empty($warn_errors) || $mybb->get_input('type') == 'custom')
{
$type_checked['custom'] = "checked=\"checked\"";

		if(empty($types) && empty($warn_errors) || $mybb->get_input('type') == 'custom')
{
$type_checked['custom'] = "checked=\"checked\"";

		}

		}


eval("\$custom_warning = \"".$templates->get("warnings_warn_custom")."\";");
}


eval("\$custom_warning = \"".$templates->get("warnings_warn_custom")."\";");
}

Zeile 584Zeile 584
	}

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

	}

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

	if(!$user)

	if(empty($user))

	{

	{

		$user['username'] = $lang->guest;

		$user = array('uid' => 0, 'username' => $lang->guest);

	}
$user['username'] = htmlspecialchars_uni($user['username']);


	}
$user['username'] = htmlspecialchars_uni($user['username']);


Zeile 599Zeile 599
	$plugins->run_hooks("warnings_view_start");

$lang->nav_profile = $lang->sprintf($lang->nav_profile, $user['username']);

	$plugins->run_hooks("warnings_view_start");

$lang->nav_profile = $lang->sprintf($lang->nav_profile, $user['username']);

	if($user['uid'])

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

	{
add_breadcrumb($lang->nav_profile, get_profile_link($user['uid']));
add_breadcrumb($lang->nav_warning_log, "warnings.php?uid={$user['uid']}");

	{
add_breadcrumb($lang->nav_profile, get_profile_link($user['uid']));
add_breadcrumb($lang->nav_warning_log, "warnings.php?uid={$user['uid']}");

Zeile 710Zeile 710
	}

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

	}

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

	if(!$user['uid'])

	if(!$user)

	{
error($lang->error_invalid_user);
}

	{
error($lang->error_invalid_user);
}