Vergleich admin/modules/user/banning.php - 1.8.0 - 1.8.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 93Zeile 93
		{
$moderation->delete_post($post['pid']);
}

		{
$moderation->delete_post($post['pid']);
}

		$cache->update_reportedcontent();

$plugins->run_hooks("admin_user_banning_prune_commit");



$plugins->run_hooks("admin_user_banning_prune_commit");

$cache->update_reportedcontent();


// Log admin action


// Log admin action

		log_admin_action($mybb->input['uid'], $user['username']);

		log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));


flash_message($lang->success_pruned, 'success');


flash_message($lang->success_pruned, 'success');

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

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

	else
{
$page->output_confirm_action("index.php?module=user-banning&action=prune&uid={$user['uid']}", $lang->confirm_prune);
}
}

	else
{
$page->output_confirm_action("index.php?module=user-banning&action=prune&uid={$user['uid']}", $lang->confirm_prune);
}
}





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

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

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


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


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

if(!$ban['uid'])
{
flash_message($lang->error_invalid_ban, 'error');

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

if(!$ban['uid'])
{
flash_message($lang->error_invalid_ban, 'error');

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

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

	}

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

	}

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

Zeile 143Zeile 144
			'additionalgroups' => $ban['oldadditionalgroups'],
'displaygroup' => $ban['olddisplaygroup']
);

			'additionalgroups' => $ban['oldadditionalgroups'],
'displaygroup' => $ban['olddisplaygroup']
);

		$db->update_query("users", $updated_group, "uid='{$ban['uid']}'");

 
		$db->delete_query("banned", "uid='{$ban['uid']}'");

		$db->delete_query("banned", "uid='{$ban['uid']}'");

 

$plugins->run_hooks("admin_user_banning_lift_commit");

$db->update_query("users", $updated_group, "uid='{$ban['uid']}'");


$cache->update_banned();
$cache->update_moderators();


$cache->update_banned();
$cache->update_moderators();


$plugins->run_hooks("admin_user_banning_lift_commit");

 

// Log admin action


// Log admin action

		log_admin_action($mybb->input['uid'], $user['username']);

flash_message($lang->success_ban_lifted, 'success');

		log_admin_action($ban['uid'], htmlspecialchars_uni($user['username']));

flash_message($lang->success_ban_lifted, 'success');

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

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

Zeile 217Zeile 219
			}

$update_array = array(

			}

$update_array = array(

				'gid' => (int)$mybb->input['usergroup'],

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

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

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

Zeile 228Zeile 230

// Move the user to the banned group
$update_array = array(


// Move the user to the banned group
$update_array = array(

				'usergroup' => (int)$mybb->input['usergroup'],

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

				'displaygroup' => 0,
'additionalgroups' => '',
);
$db->update_query('users', $update_array, "uid = {$ban['uid']}");

				'displaygroup' => 0,
'additionalgroups' => '',
);
$db->update_query('users', $update_array, "uid = {$ban['uid']}");


$cache->update_banned();

 

$plugins->run_hooks("admin_user_banning_edit_commit");


$plugins->run_hooks("admin_user_banning_edit_commit");

 

$cache->update_banned();


// Log admin action


// Log admin action

			log_admin_action($mybb->input['uid'], $user['username']);

			log_admin_action($ban['uid'], htmlspecialchars_uni($user['username']));


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


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

	}

	}

	$page->add_breadcrumb_item($lang->edit_ban);
$page->output_header($lang->edit_ban);


	$page->add_breadcrumb_item($lang->edit_ban);
$page->output_header($lang->edit_ban);


Zeile 254Zeile 256
		'description' => $lang->edit_ban_desc
);
$page->output_nav_tabs($sub_tabs, "edit");

		'description' => $lang->edit_ban_desc
);
$page->output_nav_tabs($sub_tabs, "edit");





	$form = new Form("index.php?module=user-banning&action=edit&uid={$ban['uid']}", "post");
if($errors)
{
$page->output_inline_error($errors);

	$form = new Form("index.php?module=user-banning&action=edit&uid={$ban['uid']}", "post");
if($errors)
{
$page->output_inline_error($errors);

	}

	}

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

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

	}


	}


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

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

	$form_container->output_row($lang->ban_username, "", $user['username']);

	$form_container->output_row($lang->ban_username, "", htmlspecialchars_uni($user['username']));

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

Zeile 276Zeile 278
	if($mybb->input['bantime'] == 'perm' || $mybb->input['bantime'] == '' || $mybb->input['lifted'] == 'perm' ||$mybb->input['lifted'] == '')
{
$mybb->input['bantime'] = '---';

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

		$mybb->input['lifted'] = '---';
}

		$mybb->input['lifted'] = '---';
}


foreach($ban_times as $time => $period)
{
if($time != '---')
{


foreach($ban_times as $time => $period)
{
if($time != '---')
{

			$friendly_time = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time));

			$friendly_time = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time));

			$period = "{$period} ({$friendly_time})";
}
$length_list[$time] = $period;

			$period = "{$period} ({$friendly_time})";
}
$length_list[$time] = $period;

Zeile 314Zeile 316
		$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']) && $mybb->get_input('search') != '')

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

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

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

Zeile 374Zeile 376

$insert_array = array(
'uid' => $user['uid'],


$insert_array = array(
'uid' => $user['uid'],

					'gid' => (int)$mybb->input['usergroup'],

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

					'oldgroup' => $user['usergroup'],
'oldadditionalgroups' => $user['additionalgroups'],
'olddisplaygroup' => $user['displaygroup'],

					'oldgroup' => $user['usergroup'],
'oldadditionalgroups' => $user['additionalgroups'],
'olddisplaygroup' => $user['displaygroup'],

Zeile 388Zeile 390

// Move the user to the banned group
$update_array = array(


// Move the user to the banned group
$update_array = array(

					'usergroup' => (int)$mybb->input['usergroup'],

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

					'displaygroup' => 0,
'additionalgroups' => '',
);

					'displaygroup' => 0,
'additionalgroups' => '',
);

				$db->update_query('users', $update_array, "uid = '{$user['uid']}'");





				$db->delete_query("forumsubscriptions", "uid = '{$user['uid']}'");
$db->delete_query("threadsubscriptions", "uid = '{$user['uid']}'");

				$db->delete_query("forumsubscriptions", "uid = '{$user['uid']}'");
$db->delete_query("threadsubscriptions", "uid = '{$user['uid']}'");


$cache->update_banned();

$plugins->run_hooks("admin_user_banning_start_commit");





$plugins->run_hooks("admin_user_banning_start_commit");

$db->update_query('users', $update_array, "uid = '{$user['uid']}'");

$cache->update_banned();


				// Log admin action

				// Log admin action

				log_admin_action($user['uid'], $user['username'], $lifted);

				log_admin_action($user['uid'], htmlspecialchars_uni($user['username']), $lifted);


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


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

Zeile 421Zeile 424

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


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

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

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

		$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 460Zeile 463
	// Get the banned users
while($ban = $db->fetch_array($query))
{

	// Get the banned users
while($ban = $db->fetch_array($query))
{

		$profile_link = build_profile_link($ban['username'], $ban['uid'], "_blank");

		$profile_link = build_profile_link(htmlspecialchars_uni($ban['username']), $ban['uid'], "_blank");

		$ban_date = my_date($mybb->settings['dateformat'], $ban['dateline']);
if($ban['lifted'] == 'perm' || $ban['lifted'] == '' || $ban['bantime'] == 'perm' || $ban['bantime'] == '---')
{

		$ban_date = my_date($mybb->settings['dateformat'], $ban['dateline']);
if($ban['lifted'] == 'perm' || $ban['lifted'] == '' || $ban['bantime'] == 'perm' || $ban['bantime'] == '---')
{

Zeile 486Zeile 489
			{
$time_remaining = "<span style=\"color: green;\">{$time_remaining}</span>";
}

			{
$time_remaining = "<span style=\"color: green;\">{$time_remaining}</span>";
}

			else
{
$time_remaining = "{$time_remaining}";
}






			$lifts_on = my_date($mybb->settings['dateformat'], $ban['lifted']);
}

if(!$ban['adminuser'])
{
if($ban['admin'] == 0)

			$lifts_on = my_date($mybb->settings['dateformat'], $ban['lifted']);
}

if(!$ban['adminuser'])
{
if($ban['admin'] == 0)

			{
$ban['adminuser'] = "MyBB System";
}

			{
$ban['adminuser'] = $lang->mybb_engine;
}

			else
{
$ban['adminuser'] = $ban['admin'];

			else
{
$ban['adminuser'] = $ban['admin'];

Zeile 511Zeile 511
		$table->construct_cell("<a href=\"index.php?module=user-banning&amp;action=edit&amp;uid={$ban['uid']}\">{$lang->edit}</a>", array("class" => "align_center"));
$table->construct_cell("<a href=\"index.php?module=user-banning&amp;action=lift&amp;uid={$ban['uid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_lift_ban}');\">{$lang->lift}</a>", array("class" => "align_center"));
$table->construct_cell("<a href=\"index.php?module=user-banning&amp;action=prune&amp;uid={$ban['uid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_prune}');\">{$lang->prune_threads_and_posts}</a>", array("class" => "align_center"));

		$table->construct_cell("<a href=\"index.php?module=user-banning&amp;action=edit&amp;uid={$ban['uid']}\">{$lang->edit}</a>", array("class" => "align_center"));
$table->construct_cell("<a href=\"index.php?module=user-banning&amp;action=lift&amp;uid={$ban['uid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_lift_ban}');\">{$lang->lift}</a>", array("class" => "align_center"));
$table->construct_cell("<a href=\"index.php?module=user-banning&amp;action=prune&amp;uid={$ban['uid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_prune}');\">{$lang->prune_threads_and_posts}</a>", array("class" => "align_center"));

		$table->construct_row();

		$table->construct_row();

	}

if($table->num_rows() == 0)

	}

if($table->num_rows() == 0)

	{

	{

		$table->construct_cell($lang->no_banned_users, array("colspan" => "6"));
$table->construct_row();
}

		$table->construct_cell($lang->no_banned_users, array("colspan" => "6"));
$table->construct_row();
}

Zeile 524Zeile 524

$form = new Form("index.php?module=user-banning", "post");
if($errors)


$form = new Form("index.php?module=user-banning", "post");
if($errors)

	{

	{

		$page->output_inline_error($errors);
}


		$page->output_inline_error($errors);
}


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

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

	}

	}


$form_container = new FormContainer($lang->ban_a_user);
$form_container->output_row($lang->ban_username, $lang->autocomplete_enabled, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');


$form_container = new FormContainer($lang->ban_a_user);
$form_container->output_row($lang->ban_username, $lang->autocomplete_enabled, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');

Zeile 545Zeile 545
	{
if($time != "---")
{

	{
if($time != "---")
{

			$friendly_time = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time));

			$friendly_time = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time));

			$period = "{$period} ({$friendly_time})";
}
$length_list[$time] = $period;

			$period = "{$period} ({$friendly_time})";
}
$length_list[$time] = $period;

Zeile 557Zeile 557
	// Autocompletion for usernames
echo '
<link rel="stylesheet" href="../jscripts/select2/select2.css">

	// Autocompletion for usernames
echo '
<link rel="stylesheet" href="../jscripts/select2/select2.css">

	<script type="text/javascript" src="../jscripts/select2/select2.min.js"></script>

	<script type="text/javascript" src="../jscripts/select2/select2.min.js?ver=1804"></script>

	<script type="text/javascript">
<!--
$("#username").select2({

	<script type="text/javascript">
<!--
$("#username").select2({

		placeholder: "Search for a user",
minimumInputLength: 3,
maximumSelectionSize: 3,

		placeholder: "'.$lang->search_for_a_user.'",
minimumInputLength: 2,


		multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",

		multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",

Zeile 589Zeile 588
				}).done(function(data) { callback(data); });
}
},

				}).done(function(data) { callback(data); });
}
},

 
	});

$(\'[for=username]\').click(function(){
$("#username").select2(\'open\');
return false;

	});
// -->
</script>';

$buttons[] = $form->generate_submit_button($lang->ban_user);

	});
// -->
</script>';

$buttons[] = $form->generate_submit_button($lang->ban_user);

	$buttons[] = $form->generate_submit_button($lang->search_user, array('name' => 'search'));

	$buttons[] = $form->generate_submit_button($lang->search_for_a_user, array('name' => 'search'));

	$form->output_submit_wrapper($buttons);
$form->end();


	$form->output_submit_wrapper($buttons);
$form->end();