Vergleich admin/modules/tools/maillogs.php - 1.6.5 - 1.6.15

  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: maillogs.php 5297 2010-12-28 22:01:14Z Tomm $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 22Zeile 22
if($mybb->input['action'] == "prune" && $mybb->request_method == "post")
{
$plugins->run_hooks("admin_tools_maillogs_prune");

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

	



	if($mybb->input['delete_all'])
{
$db->delete_query("maillogs");
$num_deleted = $db->affected_rows();

	if($mybb->input['delete_all'])
{
$db->delete_query("maillogs");
$num_deleted = $db->affected_rows();

		



		$plugins->run_hooks("admin_tools_maillogs_prune_delete_all_commit");

		$plugins->run_hooks("admin_tools_maillogs_prune_delete_all_commit");

		



		// Log admin action
log_admin_action($num_deleted);

		// Log admin action
log_admin_action($num_deleted);

		



		flash_message($lang->all_logs_deleted, 'success');
admin_redirect("index.php?module=tools-maillogs");
}

		flash_message($lang->all_logs_deleted, 'success');
admin_redirect("index.php?module=tools-maillogs");
}

Zeile 45Zeile 45
			$num_deleted = $db->affected_rows();
}
}

			$num_deleted = $db->affected_rows();
}
}

	



	$plugins->run_hooks("admin_tools_mailerrors_prune_commit");

	$plugins->run_hooks("admin_tools_mailerrors_prune_commit");

	



	// Log admin action
log_admin_action($num_deleted);

	// Log admin action
log_admin_action($num_deleted);

	



	flash_message($lang->selected_logs_deleted, 'success');
admin_redirect("index.php?module=tools-maillogs");
}

	flash_message($lang->selected_logs_deleted, 'success');
admin_redirect("index.php?module=tools-maillogs");
}

Zeile 58Zeile 58
if($mybb->input['action'] == "view")
{
$plugins->run_hooks("admin_tools_maillogs_view");

if($mybb->input['action'] == "view")
{
$plugins->run_hooks("admin_tools_maillogs_view");

	



	$query = $db->simple_select("maillogs", "*", "mid='".intval($mybb->input['mid'])."'");
$log = $db->fetch_array($query);

if(!$log['mid'])

	$query = $db->simple_select("maillogs", "*", "mid='".intval($mybb->input['mid'])."'");
$log = $db->fetch_array($query);

if(!$log['mid'])

	{

	{

		exit;
}


		exit;
}


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

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

	
$per_page = 20;












$per_page = $mybb->settings['threadsperpage'];

if(!$per_page)
{
if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{
$mybb->settings['threadsperpage'] = 20;
}

$per_page = 20;
}


if($mybb->input['page'] && $mybb->input['page'] > 1)
{
$mybb->input['page'] = intval($mybb->input['page']);
$start = ($mybb->input['page']*$per_page)-$per_page;


if($mybb->input['page'] && $mybb->input['page'] > 1)
{
$mybb->input['page'] = intval($mybb->input['page']);
$start = ($mybb->input['page']*$per_page)-$per_page;

	}
else

	}
else

	{
$mybb->input['page'] = 1;
$start = 0;

	{
$mybb->input['page'] = 1;
$start = 0;

	}


	}


	$additional_criteria = array();

// Filter form was submitted - play around with the values
if($mybb->request_method == "post")

	$additional_criteria = array();

// Filter form was submitted - play around with the values
if($mybb->request_method == "post")

	{

	{

		if($mybb->input['from_type'] == "user")
{
$mybb->input['fromname'] = $mybb->input['from_value'];

		if($mybb->input['from_type'] == "user")
{
$mybb->input['fromname'] = $mybb->input['from_value'];

		}

		}

		else if($mybb->input['from_type'] == "email")
{
$mybb->input['fromemail'] = $mybb->input['from_value'];

		else if($mybb->input['from_type'] == "email")
{
$mybb->input['fromemail'] = $mybb->input['from_value'];

		}


		}


		if($mybb->input['to_type'] == "user")
{
$mybb->input['toname'] = $mybb->input['to_value'];

		if($mybb->input['to_type'] == "user")
{
$mybb->input['toname'] = $mybb->input['to_value'];

Zeile 167Zeile 177
		{
$mybb->input['toemail'] = $mybb->input['to_value'];
}

		{
$mybb->input['toemail'] = $mybb->input['to_value'];
}

	}











	}

$touid = intval($mybb->input['touid']);
$toname = $db->escape_string($mybb->input['toname']);
$toemail = $db->escape_string_like($mybb->input['toemail']);

$fromuid = intval($mybb->input['fromuid']);
$fromname = $db->escape_string($mybb->input['fromname']);
$fromemail = $db->escape_string_like($mybb->input['fromemail']);

$subject = $db->escape_string_like($mybb->input['subject']);


// Begin criteria filtering
if($mybb->input['subject'])
{


// Begin criteria filtering
if($mybb->input['subject'])
{

		$additional_sql_criteria .= " AND l.subject LIKE '%".$db->escape_string($mybb->input['subject'])."%'";
$additional_criteria[] = "subject='".htmlspecialchars_uni($mybb->input['subject'])."'";

		$additional_sql_criteria .= " AND l.subject LIKE '%{$subject}%'";
$additional_criteria[] = "subject=".urlencode($mybb->input['subject']);

	}

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

	}

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

	{
$query = $db->simple_select("users", "uid, username", "uid='".intval($mybb->input['fromuid'])."'");
$user = $db->fetch_array($query);

	{
$query = $db->simple_select("users", "uid, username", "uid = '{$fromuid}'");
$user = $db->fetch_array($query);

		$from_filter = $user['username'];

		$from_filter = $user['username'];

		$additional_sql_criteria .= " AND l.fromuid='".intval($mybb->input['fromuid'])."'";
$additional_criteria[] = "fromuid='".intval($mybb->input['fromuid'])."'";



$additional_sql_criteria .= " AND l.fromuid = '{$fromuid}'";
$additional_criteria[] = "fromuid={$fromuid}";

	}
else if($mybb->input['fromname'])

	}
else if($mybb->input['fromname'])

	{
$query = $db->simple_select("users", "uid, username", "LOWER(username)='".my_strtolower($mybb->input['fromname'])."'");
$user = $db->fetch_array($query);

	{
$query = $db->simple_select("users", "uid, username", "LOWER(username) = '{$fromname}'");
$user = $db->fetch_array($query);

		$from_filter = $user['username'];

		$from_filter = $user['username'];


if(!$user['uid'])
{
flash_message($lang->error_invalid_user, 'error');
admin_redirect("index.php?module=tools-maillogs");
}
$additional_sql_criteria .= "AND l.fromuid='{$user['uid']}'";
$additional_criteria = "fromuid={$user['uid']}";
}




if(!$user['uid'])
{
flash_message($lang->error_invalid_user, 'error');
admin_redirect("index.php?module=tools-maillogs");
}

$additional_sql_criteria .= "AND l.fromuid = '{$user['uid']}'";
$additional_criteria[] = "fromuid={$user['uid']}";
}


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

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

		$additional_sql_criteria .= " AND l.fromemail LIKE '%".$db->escape_string($mybb->input['fromemail'])."%'";

		$additional_sql_criteria .= " AND l.fromemail LIKE '%{$fromemail}%'";

		$additional_criteria[] = "fromemail=".urlencode($mybb->input['fromemail']);
$from_filter = $mybb->input['fromemail'];

		$additional_criteria[] = "fromemail=".urlencode($mybb->input['fromemail']);
$from_filter = $mybb->input['fromemail'];

	}

	}


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


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

	{
$query = $db->simple_select("users", "uid, username", "uid='".intval($mybb->input['touid'])."'");
$user = $db->fetch_array($query);
$to_filter = $user['username'];
$additional_sql_criteria .= " AND l.touid='".intval($mybb->input['touid'])."'";
$additional_criteria[] = "touid='".intval($mybb->input['touid'])."'";


	{
$query = $db->simple_select("users", "uid, username", "uid = '{$touid}'");
$user = $db->fetch_array($query);
$to_filter = $user['username'];

$additional_sql_criteria .= " AND l.touid = '{$touid}'";
$additional_criteria[] = "touid={$touid}";

	}
else if($mybb->input['toname'])
{

	}
else if($mybb->input['toname'])
{

		$query = $db->simple_select("users", "uid, username", "LOWER(username)='".my_strtolower($mybb->input['toname'])."'");

		$query = $db->simple_select("users", "uid, username", "LOWER(username)='".my_strtolower($toname)."'");

		$user = $db->fetch_array($query);
$to_filter = $user['username'];


		$user = $db->fetch_array($query);
$to_filter = $user['username'];


Zeile 225Zeile 248
			flash_message($lang->error_invalid_user, 'error');
admin_redirect("index.php?module=tools-maillogs");
}

			flash_message($lang->error_invalid_user, 'error');
admin_redirect("index.php?module=tools-maillogs");
}

 


		$additional_sql_criteria .= "AND l.touid='{$user['uid']}'";

		$additional_sql_criteria .= "AND l.touid='{$user['uid']}'";

		$additional_criteria = "touid='{$user['uid']}'";
}

		$additional_criteria[] = "touid={$user['uid']}";
}


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


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

	{
$additional_sql_criteria .= " AND l.toemail LIKE '%".$db->escape_string($mybb->input['toemail'])."%'";
$additional_criteria[] = "toemail='".urlencode($mybb->input['toemail'])."'";

	{
$additional_sql_criteria .= " AND l.toemail LIKE '%{$toemail}%'";
$additional_criteria[] = "toemail=".urlencode($mybb->input['toemail']);

		$to_filter = $mybb->input['toemail'];

		$to_filter = $mybb->input['toemail'];

	}

if($additional_criteria)
{

	}

if(!empty($additional_criteria))
{

		$additional_criteria = "&amp;".implode("&amp;", $additional_criteria);

		$additional_criteria = "&amp;".implode("&amp;", $additional_criteria);

 
	}
else
{
$additional_criteria = '';

	}

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

	}

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

	



	$sub_tabs['maillogs'] = array(
'title' => $lang->user_email_log,
'link' => "index.php?module=tools-maillogs",

	$sub_tabs['maillogs'] = array(
'title' => $lang->user_email_log,
'link' => "index.php?module=tools-maillogs",

Zeile 250Zeile 278
	);

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

	);

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

	



	$form = new Form("index.php?module=tools-maillogs&amp;action=prune", "post");

$table = new Table;

	$form = new Form("index.php?module=tools-maillogs&amp;action=prune", "post");

$table = new Table;

Zeile 314Zeile 342
			{
$table->construct_cell("{$find_from}<div><a href=\"../".get_profile_link($log['fromuid'])."\">{$log['from_username']}</a></div>");
}

			{
$table->construct_cell("{$find_from}<div><a href=\"../".get_profile_link($log['fromuid'])."\">{$log['from_username']}</a></div>");
}

			$find_to = "<div class=\"float_right\"><a href=\"index.php?module=tools-maillogs&amp;touid={$log['touid']}\"><img src=\"styles/{$page->style}/images/icons/find.gif\" title=\"{$lang->find_emails_to_user}\" alt=\"{$lang->find}\" /></a></div>"; 

			$find_to = "<div class=\"float_right\"><a href=\"index.php?module=tools-maillogs&amp;touid={$log['touid']}\"><img src=\"styles/{$page->style}/images/icons/find.gif\" title=\"{$lang->find_emails_to_user}\" alt=\"{$lang->find}\" /></a></div>";

			if(!$log['to_username'])
{
$table->construct_cell("{$find_to}<div>{$lang->deleted_user}</div>");

			if(!$log['to_username'])
{
$table->construct_cell("{$find_to}<div>{$lang->deleted_user}</div>");

Zeile 327Zeile 355
		}
$table->construct_row();
}

		}
$table->construct_row();
}

	



	if($table->num_rows() == 0)
{
$table->construct_cell($lang->no_logs, array("colspan" => "6"));
$table->construct_row();

	if($table->num_rows() == 0)
{
$table->construct_cell($lang->no_logs, array("colspan" => "6"));
$table->construct_row();

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

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

	}
else
{

	}
else
{

Zeile 341Zeile 369
		$buttons[] = $form->generate_submit_button($lang->delete_all, array('name' => 'delete_all', 'onclick' => "return confirm('{$lang->confirm_delete_all_logs}');"));
$form->output_submit_wrapper($buttons);
}

		$buttons[] = $form->generate_submit_button($lang->delete_all, array('name' => 'delete_all', 'onclick' => "return confirm('{$lang->confirm_delete_all_logs}');"));
$form->output_submit_wrapper($buttons);
}

	



	$form->end();

	$form->end();

	



	$query = $db->simple_select("maillogs l", "COUNT(l.mid) as logs", "1=1 {$additional_sql_criteria}");
$total_rows = $db->fetch_field($query, "logs");

echo "<br />".draw_admin_pagination($mybb->input['page'], $per_page, $total_rows, "index.php?module=tools-maillogs&amp;page={page}{$additional_criteria}");

	$query = $db->simple_select("maillogs l", "COUNT(l.mid) as logs", "1=1 {$additional_sql_criteria}");
$total_rows = $db->fetch_field($query, "logs");

echo "<br />".draw_admin_pagination($mybb->input['page'], $per_page, $total_rows, "index.php?module=tools-maillogs&amp;page={page}{$additional_criteria}");

	



	$form = new Form("index.php?module=tools-maillogs", "post");
$form_container = new FormContainer($lang->filter_user_email_log);
$user_email = array(
"user" => $lang->username_is,
"email" => $lang->email_contains
);

	$form = new Form("index.php?module=tools-maillogs", "post");
$form_container = new FormContainer($lang->filter_user_email_log);
$user_email = array(
"user" => $lang->username_is,
"email" => $lang->email_contains
);

	$form_container->output_row($lang->subject_contains, "", $form->generate_text_box('subject', $mybb->input['subject'], array('id' => 'subject')), 'subject');	

	$form_container->output_row($lang->subject_contains, "", $form->generate_text_box('subject', $mybb->input['subject'], array('id' => 'subject')), 'subject');

	if($from_username)
{
$from_type = "user";

	if($from_username)
{
$from_type = "user";