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

  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'], $user['username']);


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


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

Zeile 113Zeile 114
{
// User clicked no
if($mybb->input['no'])

{
// 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);


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

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']}'");


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

 

$plugins->run_hooks("admin_user_banning_lift_commit");



$plugins->run_hooks("admin_user_banning_lift_commit");


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



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

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





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




		// Log admin action
log_admin_action($ban['uid'], $user['username']);

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

	}
else
{

	}
else
{

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

if(!$ban['uid'])

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

if(!$ban['uid'])

	{

	{

		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 186Zeile 188
		}
// 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']))

		}
// 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_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;
}





		// No errors? Update
if(!$errors)
{

		// No errors? Update
if(!$errors)
{

Zeile 214Zeile 216
			{
$group = array_keys($banned_groups);
$mybb->input['usergroup'] = $group[0];

			{
$group = array_keys($banned_groups);
$mybb->input['usergroup'] = $group[0];

			}

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

			}

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

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

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

			);

			);


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

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


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

// 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'], $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");

Zeile 261Zeile 263
		$page->output_inline_error($errors);
}
else

		$page->output_inline_error($errors);
}
else

	{

	{

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


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


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'] = '---';
}

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

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

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

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

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

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']}'");








$plugins->run_hooks("admin_user_banning_start_commit");

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


				$cache->update_banned();

				$cache->update_banned();


$plugins->run_hooks("admin_user_banning_start_commit");

 

// Log admin action
log_admin_action($user['uid'], $user['username'], $lifted);


// Log admin action
log_admin_action($user['uid'], $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 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']);
}


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


Zeile 498Zeile 498
			if($ban['admin'] == 0)
{
$ban['adminuser'] = "MyBB System";

			if($ban['admin'] == 0)
{
$ban['adminuser'] = "MyBB System";

			}

			}

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

Zeile 526Zeile 526
	if($errors)
{
$page->output_inline_error($errors);

	if($errors)
{
$page->output_inline_error($errors);

	}

	}


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


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

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",

		placeholder: "'.$lang->search_user.'",

		minimumInputLength: 3,
maximumSelectionSize: 3,
multiple: false,

		minimumInputLength: 3,
maximumSelectionSize: 3,
multiple: false,

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

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

 
	});

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

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

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