Vergleich warnings.php - 1.8.23 - 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);
}

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

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

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

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

		{

		{

			error_no_permission();
}
}


			error_no_permission();
}
}


	$warningshandler->set_data($warning);


	$warningshandler->set_data($warning);


	if($warningshandler->validate_warning())
{
$warninginfo = $warningshandler->insert_warning();

	if($warningshandler->validate_warning())
{
$warninginfo = $warningshandler->insert_warning();





		// 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'),
'message' => $mybb->get_input('pm_message'),
'touid' => $user['uid']
);

			$pm = array(
'subject' => $mybb->get_input('pm_subject'),
'message' => $mybb->get_input('pm_message'),
'touid' => $user['uid']
);





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

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

			}

// Some kind of friendly error notification

			}

// Some kind of friendly error notification

Zeile 132Zeile 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
{

		}
else
{

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

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

	}

	}

	else
{
$warn_errors = $warningshandler->get_friendly_errors();

	else
{
$warn_errors = $warningshandler->get_friendly_errors();

Zeile 145Zeile 147
		$mybb->input['action'] = 'warn';
}
}

		$mybb->input['action'] = 'warn';
}
}





// Warn a user
if($mybb->input['action'] == "warn")
{

// Warn a user
if($mybb->input['action'] == "warn")
{

Zeile 163Zeile 165
		if($given_today >= $mybb->usergroup['maxwarningsday'])
{
error($lang->sprintf($lang->warnings_reached_max_warnings_day, $mybb->usergroup['maxwarningsday']));

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

		}
}


		}
}


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

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

	{

	{

		error($lang->error_invalid_user);
}

if($user['uid'] == $mybb->user['uid'])
{
error($lang->warnings_error_cannot_warn_self);

		error($lang->error_invalid_user);
}

if($user['uid'] == $mybb->user['uid'])
{
error($lang->warnings_error_cannot_warn_self);

	}

	}


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


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

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

if($group_permissions['canreceivewarnings'] != 1)

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

if($group_permissions['canreceivewarnings'] != 1)

	{

	{

		error($lang->error_cant_warn_group);

		error($lang->error_cant_warn_group);

	}


	}


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

$post = $existing_warnings = '';

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

$post = $existing_warnings = '';





	// Giving a warning for a specific post
if($mybb->get_input('pid', MyBB::INPUT_INT))
{
$post = get_post($mybb->get_input('pid', MyBB::INPUT_INT));

	// Giving a warning for a specific post
if($mybb->get_input('pid', MyBB::INPUT_INT))
{
$post = get_post($mybb->get_input('pid', MyBB::INPUT_INT));





		if($post)
{
$thread = get_thread($post['tid']);

		if($post)
{
$thread = get_thread($post['tid']);

		}


		}


		if(!$post || !$thread)

		if(!$post || !$thread)

		{

		{

			error($lang->warnings_error_invalid_post);
}


			error($lang->warnings_error_invalid_post);
}


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

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

		}

		}


$post['subject'] = $parser->parse_badwords($post['subject']);
$post['subject'] = htmlspecialchars_uni($post['subject']);


$post['subject'] = $parser->parse_badwords($post['subject']);
$post['subject'] = htmlspecialchars_uni($post['subject']);

Zeile 231Zeile 233
			WHERE w.pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'
ORDER BY w.expired ASC, w.dateline DESC
");

			WHERE w.pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'
ORDER BY w.expired ASC, w.dateline DESC
");

		$first = true;

		$last_expired = -1;

		$warnings = '';
while($warning = $db->fetch_array($query))

		$warnings = '';
while($warning = $db->fetch_array($query))

		{
if($warning['expired'] != $last_expired || $first)
{

		{
if($warning['expired'] != $last_expired)
{

				if($warning['expired'] == 0)
{
eval("\$warnings .= \"".$templates->get("warnings_active_header")."\";");

				if($warning['expired'] == 0)
{
eval("\$warnings .= \"".$templates->get("warnings_active_header")."\";");

Zeile 247Zeile 249
				}
}
$last_expired = $warning['expired'];

				}
}
$last_expired = $warning['expired'];

			$first = false;

 

$post_link = "";
$warning['username'] = htmlspecialchars_uni($warning['username']);


$post_link = "";
$warning['username'] = htmlspecialchars_uni($warning['username']);

Zeile 256Zeile 257
			if($warning['type_title'])
{
$warning_type = $warning['type_title'];

			if($warning['type_title'])
{
$warning_type = $warning['type_title'];

			}

			}

			else
{
$warning_type = $warning['title'];

			else
{
$warning_type = $warning['title'];

Zeile 276Zeile 277
				else
{
$expires = nice_time($warning['expires']-TIME_NOW);

				else
{
$expires = nice_time($warning['expires']-TIME_NOW);

				}

				}

			}
else
{

			}
else
{

Zeile 296Zeile 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 311Zeile 312
	{
$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))

		{

		{

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

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

Zeile 341Zeile 342
	$lang->nav_profile = $lang->sprintf($lang->nav_profile, $user['username']);
add_breadcrumb($lang->nav_profile, get_profile_link($user['uid']));
add_breadcrumb($lang->nav_add_warning);

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





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

if($mybb->settings['maxwarningpoints'] < 1)

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

if($mybb->settings['maxwarningpoints'] < 1)

Zeile 379Zeile 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)
{
$period = fetch_friendly_expiration($level['action']['length']);

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

					$lang_str = "expiration_".$period['period'];
$period = $lang->sprintf($lang->result_period, $period['time'], $lang->$lang_str);
}

Zeile 442Zeile 443
					break;
}
}

					break;
}
}

		}

		}

		$level_diff = $new_warning_level-$current_level;
$result = '';
if(!empty($new_level['friendly_action']))

		$level_diff = $new_warning_level-$current_level;
$result = '';
if(!empty($new_level['friendly_action']))

Zeile 461Zeile 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 583Zeile 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 598Zeile 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 709Zeile 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);
}