Vergleich admin/modules/user/banning.php - 1.8.26 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 54Zeile 54
if($mybb->input['action'] == "prune")
{
// User clicked no

if($mybb->input['action'] == "prune")
{
// User clicked no

	if($mybb->input['no'])

	if($mybb->get_input('no'))

	{
admin_redirect("index.php?module=user-banning");
}

	{
admin_redirect("index.php?module=user-banning");
}

Zeile 62Zeile 62
	$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'");
$ban = $db->fetch_array($query);


	$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'");
$ban = $db->fetch_array($query);


	if(!$ban['uid'])

	if(!$ban)

	{
flash_message($lang->error_invalid_ban, 'error');
admin_redirect("index.php?module=user-banning");

	{
flash_message($lang->error_invalid_ban, 'error');
admin_redirect("index.php?module=user-banning");

Zeile 70Zeile 70

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



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


	if(is_super_admin($user['uid']) && ($mybb->user['uid'] != $user['uid'] && !is_super_admin($mybb->user['uid'])))

	if(!$user || (is_super_admin($user['uid']) && ($mybb->user['uid'] != $user['uid'] && !is_super_admin($mybb->user['uid']))))

	{
flash_message($lang->cannot_perform_action_super_admin_general, 'error');
admin_redirect("index.php?module=user-banning");

	{
flash_message($lang->cannot_perform_action_super_admin_general, 'error');
admin_redirect("index.php?module=user-banning");

Zeile 114Zeile 114
if($mybb->input['action'] == "lift")
{
// User clicked no

if($mybb->input['action'] == "lift")
{
// User clicked no

	if($mybb->input['no'])

	if($mybb->get_input('no'))

	{
admin_redirect("index.php?module=user-banning");
}

	{
admin_redirect("index.php?module=user-banning");
}

Zeile 122Zeile 122
	$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'");
$ban = $db->fetch_array($query);


	$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'");
$ban = $db->fetch_array($query);


	if(!$ban['uid'])

	if(!$ban)

	{
flash_message($lang->error_invalid_ban, 'error');
admin_redirect("index.php?module=user-banning");

	{
flash_message($lang->error_invalid_ban, 'error');
admin_redirect("index.php?module=user-banning");

Zeile 130Zeile 130

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



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


	if(is_super_admin($user['uid']) && ($mybb->user['uid'] != $user['uid'] && !is_super_admin($mybb->user['uid'])))

	if(!$user || (is_super_admin($user['uid']) && ($mybb->user['uid'] != $user['uid'] && !is_super_admin($mybb->user['uid']))))

	{
flash_message($lang->cannot_perform_action_super_admin_general, 'error');
admin_redirect("index.php?module=user-banning");

	{
flash_message($lang->cannot_perform_action_super_admin_general, 'error');
admin_redirect("index.php?module=user-banning");

Zeile 170Zeile 170
	$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'");
$ban = $db->fetch_array($query);


	$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'");
$ban = $db->fetch_array($query);


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

if(!$ban['uid'])

	if(!$ban)



	{
flash_message($lang->error_invalid_ban, 'error');
admin_redirect("index.php?module=user-banning");
}

	{
flash_message($lang->error_invalid_ban, 'error');
admin_redirect("index.php?module=user-banning");
}

 

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


$plugins->run_hooks("admin_user_banning_edit");

if($mybb->request_method == "post")
{


$plugins->run_hooks("admin_user_banning_edit");

if($mybb->request_method == "post")
{

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

		if(empty($ban['uid']))
{

			$errors[] = $lang->error_invalid_username;
}
// Is the user we're trying to ban a super admin and we're not?
else if(is_super_admin($ban['uid']) && !is_super_admin($ban['uid']))
{
$errors[] = $lang->error_no_perm_to_ban;

			$errors[] = $lang->error_invalid_username;
}
// Is the user we're trying to ban a super admin and we're not?
else if(is_super_admin($ban['uid']) && !is_super_admin($ban['uid']))
{
$errors[] = $lang->error_no_perm_to_ban;

		}


		}


		if($ban['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_ban_self;

		if($ban['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_ban_self;

Zeile 204Zeile 204
			if($mybb->input['bantime'] == '---')
{
$lifted = 0;

			if($mybb->input['bantime'] == '---')
{
$lifted = 0;

			}
else
{

			}
else
{

				$lifted = ban_date2timestamp($mybb->input['bantime'], $ban['dateline']);
}


				$lifted = ban_date2timestamp($mybb->input['bantime'], $ban['dateline']);
}


Zeile 263Zeile 263
	else
{
$mybb->input = array_merge($mybb->input, $ban);

	else
{
$mybb->input = array_merge($mybb->input, $ban);

 
	}

if(!empty($ban['gid']))
{
$mybb->input['usergroup'] = $ban['gid'];
}
else if(!empty($user['usergroup']))
{
$mybb->input['usergroup'] = $user['usergroup'];
}
else
{
$mybb->input['usergroup'] = 0;

	}

$form_container = new FormContainer($lang->edit_ban);

	}

$form_container = new FormContainer($lang->edit_ban);

Zeile 310Zeile 323
		$options = array(
'fields' => array('username', 'usergroup', 'additionalgroups', 'displaygroup')
);

		$options = array(
'fields' => array('username', 'usergroup', 'additionalgroups', 'displaygroup')
);





		$user = get_user_by_username($mybb->input['username'], $options);

// Are we searching a user?

		$user = get_user_by_username($mybb->input['username'], $options);

// Are we searching a user?

		if(isset($mybb->input['search']))

		if(is_array($user) && isset($mybb->input['search']))

		{
$where_sql = 'uid=\''.(int)$user['uid'].'\'';
$where_sql_full = 'WHERE b.uid=\''.(int)$user['uid'].'\'';
}
else
{

		{
$where_sql = 'uid=\''.(int)$user['uid'].'\'';
$where_sql_full = 'WHERE b.uid=\''.(int)$user['uid'].'\'';
}
else
{

			if(!$user['uid'])

			if(!$user)

			{
$errors[] = $lang->error_invalid_username;
}
// Is the user we're trying to ban a super admin and we're not?
else if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))

			{
$errors[] = $lang->error_invalid_username;
}
// Is the user we're trying to ban a super admin and we're not?
else if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))

			{

			{

				$errors[] = $lang->error_no_perm_to_ban;
}
else

				$errors[] = $lang->error_no_perm_to_ban;
}
else

			{

			{

				$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'");
if($db->fetch_field($query, "uid"))

				$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'");
if($db->fetch_field($query, "uid"))

				{
$errors[] = $lang->error_already_banned;

				{
$errors[] = $lang->error_already_banned;

				}

// Get PRIMARY usergroup information

				}

// Get PRIMARY usergroup information

Zeile 343Zeile 356
				if(!empty($usergroups[$user['usergroup']]) && $usergroups[$user['usergroup']]['isbannedgroup'] == 1)
{
$errors[] = $lang->error_already_banned;

				if(!empty($usergroups[$user['usergroup']]) && $usergroups[$user['usergroup']]['isbannedgroup'] == 1)
{
$errors[] = $lang->error_already_banned;

				}
}

if($user['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_ban_self;
}

				}

if($user['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_ban_self;
}
}


// No errors? Insert
if(!$errors)


// No errors? Insert
if(!$errors)

Zeile 358Zeile 371
				if($mybb->input['bantime'] == '---')
{
$lifted = 0;

				if($mybb->input['bantime'] == '---')
{
$lifted = 0;

				}

				}

				else
{
$lifted = ban_date2timestamp($mybb->input['bantime']);

				else
{
$lifted = ban_date2timestamp($mybb->input['bantime']);

				}

				}


$reason = my_substr($mybb->input['reason'], 0, 255);



$reason = my_substr($mybb->input['reason'], 0, 255);


Zeile 383Zeile 396
					'bantime' => $db->escape_string($mybb->input['bantime']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($reason)

					'bantime' => $db->escape_string($mybb->input['bantime']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($reason)

				);

				);

				$db->insert_query('banned', $insert_array);

// Move the user to the banned group

				$db->insert_query('banned', $insert_array);

// Move the user to the banned group

Zeile 418Zeile 431

$per_page = 20;



$per_page = 20;


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

	if($mybb->input['page'] > 0)
{

	if($mybb->input['page'] > 0)
{

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

		$current_page = $mybb->input['page'];

		$start = ($current_page-1)*$per_page;
$pages = $ban_count / $per_page;
$pages = ceil($pages);

		$start = ($current_page-1)*$per_page;
$pages = $ban_count / $per_page;
$pages = ceil($pages);

Zeile 444Zeile 458
		$page->output_inline_error($errors);
}


		$page->output_inline_error($errors);
}


	if($mybb->input['uid'] && !$mybb->input['username'])





	$mybb->input['username'] = $mybb->get_input('username');
$mybb->input['reason'] = $mybb->get_input('reason');
$mybb->input['bantime'] = $mybb->get_input('bantime');

if(isset($mybb->input['uid']) && empty($mybb->input['username']))

	{
$user = get_user($mybb->input['uid']);
$mybb->input['username'] = $user['username'];

	{
$user = get_user($mybb->input['uid']);
$mybb->input['username'] = $user['username'];

 
	}

if(empty($mybb->input['usergroup']))
{
if(!empty($mybb->settings['purgespammerbangroup']))
{
$mybb->input['usergroup'] = $mybb->settings['purgespammerbangroup'];
}
else if(count($banned_groups))
{
$group = array_keys($banned_groups);
$mybb->input['usergroup'] = $group[0];
}
else
{
$mybb->input['usergroup'] = 0;
}

	}

$form_container = new FormContainer($lang->ban_a_user);

	}

$form_container = new FormContainer($lang->ban_a_user);

Zeile 455Zeile 490
	$form_container->output_row($lang->ban_reason, "", $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason', 'maxlength' => '255')), 'reason');
if(count($banned_groups) > 1)
{

	$form_container->output_row($lang->ban_reason, "", $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason', 'maxlength' => '255')), 'reason');
if(count($banned_groups) > 1)
{

		$form_container->output_row($lang->ban_group, $lang->add_ban_group_desc, $form->generate_select_box('usergroup', $banned_groups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');

		$form_container->output_row($lang->ban_group, $lang->ban_group_desc, $form->generate_select_box('usergroup', $banned_groups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');

	}
foreach($ban_times as $time => $period)
{

	}
foreach($ban_times as $time => $period)
{