Vergleich admin/modules/user/banning.php - 1.4.4 - 1.4.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: banning.php 4111 2008-08-13 06:14:12Z Tikitiki $

 * $Id: banning.php 4340 2009-04-05 17:10:22Z Tikitiki $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 211Zeile 211
	{
$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');
}

	{
$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');
}

 
	
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)
{
if($time != "---")

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

Zeile 234Zeile 241
if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_user_banning_start");

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_user_banning_start");

	

	

	if($mybb->request_method == "post")
{
$query = $db->simple_select("users", "uid, usergroup, additionalgroups, displaygroup, username", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));
$user = $db->fetch_array($query);

	if($mybb->request_method == "post")
{
$query = $db->simple_select("users", "uid, usergroup, additionalgroups, displaygroup, username", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));
$user = $db->fetch_array($query);





		if(!$user['uid'])

		if(!$user['uid'])

		{

		{

			$errors[] = $lang->error_invalid_username;
}
// Is the user we're trying to ban a super admin and we're not?

			$errors[] = $lang->error_invalid_username;
}
// Is the user we're trying to ban a super admin and we're not?

Zeile 255Zeile 262
			if($db->fetch_field($query, "uid"))
{
$errors[] = $lang->error_already_banned;

			if($db->fetch_field($query, "uid"))
{
$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;

Zeile 272Zeile 279
				$lifted = 0;
}
else

				$lifted = 0;
}
else

			{

			{

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


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


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

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

			}

			}

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

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

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

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

			$cache->update_banned();

$plugins->run_hooks("admin_user_banning_start_commit");

Zeile 327Zeile 334
	$ban_count = $db->fetch_field($query, "ban_count");

$per_page = 20;

	$ban_count = $db->fetch_field($query, "ban_count");

$per_page = 20;





	if($mybb->input['page'] > 0)
{
$current_page = intval($mybb->input['page']);

	if($mybb->input['page'] > 0)
{
$current_page = intval($mybb->input['page']);

Zeile 372Zeile 379
		if($ban['lifted'] == 'perm' || $ban['lifted'] == '' || $ban['bantime'] == 'perm' || $ban['bantime'] == '---')
{
$ban_period = $lang->permenantly;

		if($ban['lifted'] == 'perm' || $ban['lifted'] == '' || $ban['bantime'] == 'perm' || $ban['bantime'] == '---')
{
$ban_period = $lang->permenantly;

			$time_remaning = $lifts_on = $lang->na;

			$time_remaining = $lifts_on = $lang->na;

		}
else
{

		}
else
{

Zeile 398Zeile 405
				$time_remaining = "{$time_remaining}";
}
$lifts_on = my_date($mybb->settings['dateformat'], $ban['lifted']);

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

 
		}

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

		}


		}


		$table->construct_cell($lang->sprintf($lang->bannedby_x_on_x, $profile_link, $ban['adminuser'], $ban_date, $ban_period));

		$table->construct_cell($lang->sprintf($lang->bannedby_x_on_x, $profile_link, htmlspecialchars_uni($ban['adminuser']), $ban_date, $ban_period));

		$table->construct_cell($lifts_on, array("class" => "align_center"));
$table->construct_cell($time_remaining, 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($lifts_on, array("class" => "align_center"));
$table->construct_cell($time_remaining, 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"));