Vergleich admin/modules/tools/warninglog.php - 1.6.7 - 1.6.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: warninglog.php 5453 2011-04-21 23:58:33Z jammerx2 $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 23Zeile 23
if($mybb->input['action'] == "do_revoke" && $mybb->request_method == "post")
{
$plugins->run_hooks("admin_tools_warninglog_do_revoke");

if($mybb->input['action'] == "do_revoke" && $mybb->request_method == "post")
{
$plugins->run_hooks("admin_tools_warninglog_do_revoke");

	



	$query = $db->simple_select("warnings", "*", "wid='".intval($mybb->input['wid'])."'");
$warning = $db->fetch_array($query);


	$query = $db->simple_select("warnings", "*", "wid='".intval($mybb->input['wid'])."'");
$warning = $db->fetch_array($query);


Zeile 35Zeile 35
	else if($warning['daterevoked'])
{
flash_message($lang->error_already_revoked, 'error');

	else if($warning['daterevoked'])
{
flash_message($lang->error_already_revoked, 'error');

		admin_redirect("index.php?module=tools-warninglog&action=view&wid={$warning['wid']}");
}

		admin_redirect("index.php?module=tools-warninglog&action=view&wid={$warning['wid']}");
}


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



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


Zeile 55Zeile 55
			{
$new_warning_points = 0;
}

			{
$new_warning_points = 0;
}





			// Update user
$updated_user = array(
"warningpoints" => $new_warning_points
);
$db->update_query("users", $updated_user, "uid='{$warning['uid']}'");
}

			// Update user
$updated_user = array(
"warningpoints" => $new_warning_points
);
$db->update_query("users", $updated_user, "uid='{$warning['uid']}'");
}





		// Update warning
$updated_warning = array(
"expired" => 1,

		// Update warning
$updated_warning = array(
"expired" => 1,

Zeile 71Zeile 71
			"revokereason" => $db->escape_string($mybb->input['reason'])
);
$db->update_query("warnings", $updated_warning, "wid='{$warning['wid']}'");

			"revokereason" => $db->escape_string($mybb->input['reason'])
);
$db->update_query("warnings", $updated_warning, "wid='{$warning['wid']}'");

		



		$plugins->run_hooks("admin_tools_warninglog_do_revoke_commit");

		$plugins->run_hooks("admin_tools_warninglog_do_revoke_commit");

		



		flash_message($lang->redirect_warning_revoked, 'success');
admin_redirect("index.php?module=tools-warninglog&action=view&wid={$warning['wid']}");

		flash_message($lang->redirect_warning_revoked, 'success');
admin_redirect("index.php?module=tools-warninglog&action=view&wid={$warning['wid']}");

	}

	}

}

}





// Detailed view of a warning
if($mybb->input['action'] == "view")
{
$plugins->run_hooks("admin_tools_warninglog_view");

// Detailed view of a warning
if($mybb->input['action'] == "view")
{
$plugins->run_hooks("admin_tools_warninglog_view");

	



	$query = $db->query("
SELECT w.*, t.title AS type_title, u.username, p.subject AS post_subject
FROM ".TABLE_PREFIX."warnings w

	$query = $db->query("
SELECT w.*, t.title AS type_title, u.username, p.subject AS post_subject
FROM ".TABLE_PREFIX."warnings w

Zeile 103Zeile 103
	$user = get_user(intval($warning['uid']));

$page->add_breadcrumb_item($lang->warning_details, "index.php?module=tools-warninglog&action=view&wid={$warning['wid']}");

	$user = get_user(intval($warning['uid']));

$page->add_breadcrumb_item($lang->warning_details, "index.php?module=tools-warninglog&action=view&wid={$warning['wid']}");

	



	$page->output_header($lang->warning_details);

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

	$page->output_header($lang->warning_details);

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

Zeile 113Zeile 113
		$page->output_inline_error($warn_errors);
$mybb->input['reason'] = htmlspecialchars_uni($mybb->input['reason']);
}

		$page->output_inline_error($warn_errors);
$mybb->input['reason'] = htmlspecialchars_uni($mybb->input['reason']);
}

	



	$table = new Table;

$post_link = "";

	$table = new Table;

$post_link = "";

Zeile 124Zeile 124
			require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
}

			require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
}

		



		$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']);
$warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']);
$post_link = get_post_link($warning['pid']);
$table->construct_cell("<strong>{$lang->warned_user}</strong><br /><br />{$user_link}");
$table->construct_cell("<strong>{$lang->post}</strong><br /><br /><a href=\"{$mybb->settings['bburl']}/{$post_link}\" target=\"_blank\">{$warning['post_subject']}</a>");

		$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']);
$warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']);
$post_link = get_post_link($warning['pid']);
$table->construct_cell("<strong>{$lang->warned_user}</strong><br /><br />{$user_link}");
$table->construct_cell("<strong>{$lang->post}</strong><br /><br /><a href=\"{$mybb->settings['bburl']}/{$post_link}\" target=\"_blank\">{$warning['post_subject']}</a>");

		$table->construct_row();
}

		$table->construct_row();
}

	else
{
$table->construct_cell("<strong>{$lang->warned_user}</strong><br /><br />{$user_link}", array('colspan' => 2));
$table->construct_row();

	else
{
$table->construct_cell("<strong>{$lang->warned_user}</strong><br /><br />{$user_link}", array('colspan' => 2));
$table->construct_row();

	}	

	}





	$issuedby = build_profile_link($warning['username'], $warning['uid'], "_blank");

	$issuedby = build_profile_link($warning['username'], $warning['issuedby'], "_blank");

	$notes = nl2br(htmlspecialchars_uni($warning['notes']));

	$notes = nl2br(htmlspecialchars_uni($warning['notes']));

	



	$date_issued = my_date($mybb->settings['dateformat'], $warning['dateline']).", ".my_date($mybb->settings['timeformat'], $warning['dateline']);
if($warning['type_title'])
{
$warning_type = $warning['type_title'];

	$date_issued = my_date($mybb->settings['dateformat'], $warning['dateline']).", ".my_date($mybb->settings['timeformat'], $warning['dateline']);
if($warning['type_title'])
{
$warning_type = $warning['type_title'];

	}
else

	}
else

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

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

Zeile 155Zeile 155
	{
$warning['points'] = "+{$warning['points']}";
}

	{
$warning['points'] = "+{$warning['points']}";
}

	



	$points = $lang->sprintf($lang->warning_points, $warning['points']);
if($warning['expired'] != 1)
{
if($warning['expires'] == 0)

	$points = $lang->sprintf($lang->warning_points, $warning['points']);
if($warning['expired'] != 1)
{
if($warning['expires'] == 0)

		{

		{

			$expires = $lang->never;
}
else
{
$expires = my_date($mybb->settings['dateformat'], $warning['expires']).", ".my_date($mybb->settings['timeformat'], $warning['expires']);

			$expires = $lang->never;
}
else
{
$expires = my_date($mybb->settings['dateformat'], $warning['expires']).", ".my_date($mybb->settings['timeformat'], $warning['expires']);

		}

		}

		$status = $lang->warning_active;
}
else

		$status = $lang->warning_active;
}
else

Zeile 180Zeile 180
			$expires = $status = $lang->already_expired;
}
}

			$expires = $status = $lang->already_expired;
}
}

	



	$table->construct_cell("<strong>{$lang->warning}</strong><br /><br />{$warning_type} {$points}", array('width' => '50%'));
$table->construct_cell("<strong>{$lang->date_issued}</strong><br /><br />{$date_issued}", array('width' => '50%'));
$table->construct_row();

	$table->construct_cell("<strong>{$lang->warning}</strong><br /><br />{$warning_type} {$points}", array('width' => '50%'));
$table->construct_cell("<strong>{$lang->date_issued}</strong><br /><br />{$date_issued}", array('width' => '50%'));
$table->construct_row();

	



	$table->construct_cell("<strong>{$lang->issued_by}</strong><br /><br />{$issuedby}", array('width' => '50%'));
$table->construct_cell("<strong>{$lang->expires}</strong><br /><br />{$expires}", array('width' => '50%'));

	$table->construct_cell("<strong>{$lang->issued_by}</strong><br /><br />{$issuedby}", array('width' => '50%'));
$table->construct_cell("<strong>{$lang->expires}</strong><br /><br />{$expires}", array('width' => '50%'));

	$table->construct_row();


	$table->construct_row();


	$table->construct_cell("<strong>{$lang->warning_note}</strong><br /><br />{$notes}", array('colspan' => 2));
$table->construct_row();

	$table->construct_cell("<strong>{$lang->warning_note}</strong><br /><br />{$notes}", array('colspan' => 2));
$table->construct_row();

	



	$table->output("<div class=\"float_right\" style=\"font-weight: normal;\">{$status}</div>".$lang->warning_details);

if(!$warning['daterevoked'])

	$table->output("<div class=\"float_right\" style=\"font-weight: normal;\">{$status}</div>".$lang->warning_details);

if(!$warning['daterevoked'])

Zeile 200Zeile 200
		$form_container = new FormContainer($lang->revoke_warning);
echo $form->generate_hidden_field('action', 'do_revoke');
echo $form->generate_hidden_field('wid', $warning['wid']);

		$form_container = new FormContainer($lang->revoke_warning);
echo $form->generate_hidden_field('action', 'do_revoke');
echo $form->generate_hidden_field('wid', $warning['wid']);

		$form_container->output_row("", $lang->revoke_warning_desc, $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason')), 'reason');	


		$form_container->output_row("", $lang->revoke_warning_desc, $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason')), 'reason');


		$form_container->end();
$buttons[] = $form->generate_submit_button($lang->revoke_warning);
$form->output_submit_wrapper($buttons);

		$form_container->end();
$buttons[] = $form->generate_submit_button($lang->revoke_warning);
$form->output_submit_wrapper($buttons);

Zeile 213Zeile 213
		$revoked_user = get_user($warning['revokedby']);
$revoked_by = build_profile_link($revoked_user['username'], $revoked_user['uid'], "_blank");
$revoke_reason = nl2br(htmlspecialchars_uni($warning['revokereason']));

		$revoked_user = get_user($warning['revokedby']);
$revoked_by = build_profile_link($revoked_user['username'], $revoked_user['uid'], "_blank");
$revoke_reason = nl2br(htmlspecialchars_uni($warning['revokereason']));

		



		$revoke_table = new Table;
$revoke_table->construct_cell("<strong>{$lang->revoked_by}</strong><br /><br />{$revoked_by}", array('width' => '50%'));
$revoke_table->construct_cell("<strong>{$lang->date_revoked}</strong><br /><br />{$date_revoked}", array('width' => '50%'));

		$revoke_table = new Table;
$revoke_table->construct_cell("<strong>{$lang->revoked_by}</strong><br /><br />{$revoked_by}", array('width' => '50%'));
$revoke_table->construct_cell("<strong>{$lang->date_revoked}</strong><br /><br />{$date_revoked}", array('width' => '50%'));

		$revoke_table->construct_row();


		$revoke_table->construct_row();


		$revoke_table->construct_cell("<strong>{$lang->reason}</strong><br /><br />{$revoke_reason}", array('colspan' => 2));
$revoke_table->construct_row();

		$revoke_table->construct_cell("<strong>{$lang->reason}</strong><br /><br />{$revoke_reason}", array('colspan' => 2));
$revoke_table->construct_row();

		



		$revoke_table->output($lang->warning_is_revoked);
}

		$revoke_table->output($lang->warning_is_revoked);
}

	



	$page->output_footer();
}

	$page->output_footer();
}





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

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

	



	$page->output_header($lang->warning_logs);

	$page->output_header($lang->warning_logs);

	



	$sub_tabs['warning_logs'] = array(
'title' => $lang->warning_logs,
'link' => "index.php?module=tools-warninglog",
'description' => $lang->warning_logs_desc
);

	$sub_tabs['warning_logs'] = array(
'title' => $lang->warning_logs,
'link' => "index.php?module=tools-warninglog",
'description' => $lang->warning_logs_desc
);

	



	$page->output_nav_tabs($sub_tabs, 'warning_logs');

	$page->output_nav_tabs($sub_tabs, 'warning_logs');

	



	// Filter options
$where_sql = '';
if($mybb->input['filter']['username'])

	// Filter options
$where_sql = '';
if($mybb->input['filter']['username'])

Zeile 249Zeile 249
		$search['username'] = $db->escape_string($mybb->input['filter']['username']);
$query = $db->simple_select("users", "uid", "username='{$search['username']}'");
$mybb->input['filter']['uid'] = $db->fetch_field($query, "uid");

		$search['username'] = $db->escape_string($mybb->input['filter']['username']);
$query = $db->simple_select("users", "uid", "username='{$search['username']}'");
$mybb->input['filter']['uid'] = $db->fetch_field($query, "uid");

	}

	}

	if($mybb->input['filter']['uid'])
{
$search['uid'] = intval($mybb->input['filter']['uid']);

	if($mybb->input['filter']['uid'])
{
$search['uid'] = intval($mybb->input['filter']['uid']);

Zeile 278Zeile 278
	}
if($mybb->input['filter']['reason'])
{

	}
if($mybb->input['filter']['reason'])
{

		$search['reason'] = $db->escape_string($mybb->input['filter']['reason']);

		$search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']);

		$where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
}
$sortbysel = array();

		$where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
}
$sortbysel = array();

Zeile 311Zeile 311
	{
$ordersel['asc'] = ' selected="selected"';
}

	{
$ordersel['asc'] = ' selected="selected"';
}

	



	// Expire any warnings past their expiration date
expire_warnings();


	// Expire any warnings past their expiration date
expire_warnings();


Zeile 328Zeile 328
	$total_warnings = $db->fetch_field($query, 'count');
$view_page = 1;
if(isset($mybb->input['page']) && intval($mybb->input['page']) > 0)

	$total_warnings = $db->fetch_field($query, 'count');
$view_page = 1;
if(isset($mybb->input['page']) && intval($mybb->input['page']) > 0)

	{

	{

		$view_page = intval($mybb->input['page']);
}
$per_page = 20;

		$view_page = intval($mybb->input['page']);
}
$per_page = 20;

Zeile 345Zeile 345
		{
$value = urlencode($value);
$url .= "&amp;filter[{$field}]={$value}";

		{
$value = urlencode($value);
$url .= "&amp;filter[{$field}]={$value}";

		}		

		}

	}

// The actual query

	}

// The actual query

Zeile 365Zeile 365
		LIMIT {$start}, {$per_page}
";
$query = $db->query($sql);

		LIMIT {$start}, {$per_page}
";
$query = $db->query($sql);

	




$table = new Table;
$table->construct_header($lang->warned_user, array('width' => '15%'));


$table = new Table;
$table->construct_header($lang->warned_user, array('width' => '15%'));

Zeile 374Zeile 374
	$table->construct_header($lang->expires, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->issued_by, array("class" => "align_center", 'width' => '15%'));
$table->construct_header($lang->options, array("class" => "align_center", 'width' => '5%'));

	$table->construct_header($lang->expires, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->issued_by, array("class" => "align_center", 'width' => '15%'));
$table->construct_header($lang->options, array("class" => "align_center", 'width' => '5%'));

	



	while($row = $db->fetch_array($query))
{
if(!$row['username'])
{
$row['username'] = $lang->guest;
}

	while($row = $db->fetch_array($query))
{
if(!$row['username'])
{
$row['username'] = $lang->guest;
}

		



		$trow = alt_trow();
$username = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
if(!$row['uid'])

		$trow = alt_trow();
$username = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
if(!$row['uid'])

Zeile 419Zeile 419
		{
$points = '+'.$row['points'];
}

		{
$points = '+'.$row['points'];
}

		 



		$table->construct_cell($username_link);
$table->construct_cell("{$title} ({$points})");
$table->construct_cell($issued_date, array("class" => "align_center"));

		$table->construct_cell($username_link);
$table->construct_cell("{$title} ({$points})");
$table->construct_cell($issued_date, array("class" => "align_center"));

Zeile 428Zeile 428
		$table->construct_cell("<a href=\"index.php?module=tools-warninglog&amp;action=view&amp;wid={$row['wid']}\">{$lang->view}</a>", array("class" => "align_center"));
$table->construct_row();
}

		$table->construct_cell("<a href=\"index.php?module=tools-warninglog&amp;action=view&amp;wid={$row['wid']}\">{$lang->view}</a>", array("class" => "align_center"));
$table->construct_row();
}

	



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

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

	{

	{

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

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

	



	$table->output($lang->warning_logs);

	$table->output($lang->warning_logs);

	



	// Do we need to construct the pagination?
if($total_warnings > $per_page)
{
echo draw_admin_pagination($view_page, $per_page, $total_warnings, $url)."<br />";
}

	// Do we need to construct the pagination?
if($total_warnings > $per_page)
{
echo draw_admin_pagination($view_page, $per_page, $total_warnings, $url)."<br />";
}

	



	$sort_by = array(
'expires' => $lang->expiry_date,
'dateline' => $lang->issued_date,
'username' => $lang->warned_user,
'issuedby' => $lang->issued_by

	$sort_by = array(
'expires' => $lang->expiry_date,
'dateline' => $lang->issued_date,
'username' => $lang->warned_user,
'issuedby' => $lang->issued_by

	);


	);


	$order_array = array(
'asc' => $lang->asc,
'desc' => $lang->desc
);

	$order_array = array(
'asc' => $lang->asc,
'desc' => $lang->desc
);





	$form = new Form("index.php?module=tools-warninglog", "post");
$form_container = new FormContainer($lang->filter_warning_logs);

	$form = new Form("index.php?module=tools-warninglog", "post");
$form_container = new FormContainer($lang->filter_warning_logs);

	$form_container->output_row($lang->filter_warned_user, "", $form->generate_text_box('filter[username]', $mybb->input['filter']['username'], array('id' => 'filter_username')), 'filter_username');	

	$form_container->output_row($lang->filter_warned_user, "", $form->generate_text_box('filter[username]', $mybb->input['filter']['username'], array('id' => 'filter_username')), 'filter_username');

	$form_container->output_row($lang->filter_issued_by, "", $form->generate_text_box('filter[mod_username]', $mybb->input['filter']['mod_username'], array('id' => 'filter_mod_username')), 'filter_mod_username');
$form_container->output_row($lang->filter_reason, "", $form->generate_text_box('filter[reason]', $mybb->input['filter']['reason'], array('id' => 'filter_reason')), 'filter_reason');

	$form_container->output_row($lang->filter_issued_by, "", $form->generate_text_box('filter[mod_username]', $mybb->input['filter']['mod_username'], array('id' => 'filter_mod_username')), 'filter_mod_username');
$form_container->output_row($lang->filter_reason, "", $form->generate_text_box('filter[reason]', $mybb->input['filter']['reason'], array('id' => 'filter_reason')), 'filter_reason');

	$form_container->output_row($lang->sort_by, "", $form->generate_select_box('filter[sortby]', $sort_by, $mybb->input['filter']['sortby'], array('id' => 'filter_sortby'))." {$lang->in} ".$form->generate_select_box('filter[order]', $order_array, $order, array('id' => 'filter_order'))." {$lang->order}", 'filter_order');	
$form_container->output_row($lang->results_per_page, "", $form->generate_text_box('filter[per_page]', $per_page, array('id' => 'filter_per_page')), 'filter_per_page');


	$form_container->output_row($lang->sort_by, "", $form->generate_select_box('filter[sortby]', $sort_by, $mybb->input['filter']['sortby'], array('id' => 'filter_sortby'))." {$lang->in} ".$form->generate_select_box('filter[order]', $order_array, $order, array('id' => 'filter_order'))." {$lang->order}", 'filter_order');
$form_container->output_row($lang->results_per_page, "", $form->generate_text_box('filter[per_page]', $per_page, array('id' => 'filter_per_page')), 'filter_per_page');


	$form_container->end();
$buttons[] = $form->generate_submit_button($lang->filter_warning_logs);
$form->output_submit_wrapper($buttons);
$form->end();

	$form_container->end();
$buttons[] = $form->generate_submit_button($lang->filter_warning_logs);
$form->output_submit_wrapper($buttons);
$form->end();

	



	$page->output_footer();
}
?>

	$page->output_footer();
}
?>