Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: warninglog.php 5016 2010-06-12 00:24:02Z RyanGordon $
| * $Id$
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 23 | Zeile 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 41 | Zeile 41 |
---|
$user = get_user($warning['uid']);
if(!trim($mybb->input['reason']))
|
$user = get_user($warning['uid']);
if(!trim($mybb->input['reason']))
|
{
| {
|
$warn_errors[] = $lang->error_no_revoke_reason; $mybb->input['action'] = "view"; }
| $warn_errors[] = $lang->error_no_revoke_reason; $mybb->input['action'] = "view"; }
|
Zeile 71 | Zeile 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']}"); }
|
Zeile 83 | Zeile 83 |
---|
if($mybb->input['action'] == "view") { $plugins->run_hooks("admin_tools_warninglog_view");
|
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 98 | Zeile 98 |
---|
{ flash_message($lang->error_invalid_warning, 'error'); admin_redirect("index.php?module=tools-warninglog");
|
{ flash_message($lang->error_invalid_warning, 'error'); admin_redirect("index.php?module=tools-warninglog");
|
}
$user = get_user(intval($warning['uid']));
| }
$user = get_user(intval($warning['uid']));
|
$page->add_breadcrumb_item($lang->warning_details, "index.php?module=tools-warninglog&action=view&wid={$warning['wid']}");
|
$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']);
| $page->output_header($lang->warning_details);
$user_link = build_profile_link($user['username'], $user['uid'], "_blank");
|
if(is_array($warn_errors)) { $page->output_inline_error($warn_errors); $mybb->input['reason'] = htmlspecialchars_uni($mybb->input['reason']); }
|
if(is_array($warn_errors)) { $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 124 | Zeile 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}");
|
$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=\"{$post_link}\">{$warning['post_subject']}</a>"); $table->construct_row(); }
| $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(); }
|
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']);
| }
$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 = htmlspecialchars_uni($warning_type);
| $warning_type = $warning['title']; } $warning_type = htmlspecialchars_uni($warning_type);
|
Zeile 155 | Zeile 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 = $lang->never; } else
|
Zeile 180 | Zeile 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'])
|
{
| {
|
$form = new Form("index.php?module=tools-warninglog", "post"); $form_container = new FormContainer($lang->revoke_warning); echo $form->generate_hidden_field('action', 'do_revoke'); echo $form->generate_hidden_field('wid', $warning['wid']);
|
$form = new Form("index.php?module=tools-warninglog", "post"); $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 211 | Zeile 211 |
---|
{ $date_revoked = my_date($mybb->settings['dateformat'], $warning['daterevoked']).", ".my_date($mybb->settings['timeformat'], $warning['daterevoked']); $revoked_user = get_user($warning['revokedby']);
|
{ $date_revoked = my_date($mybb->settings['dateformat'], $warning['daterevoked']).", ".my_date($mybb->settings['timeformat'], $warning['daterevoked']); $revoked_user = get_user($warning['revokedby']);
|
$revoked_by = build_profile_link($revoked_user['username'], $revoked_user['uid']);
| $revoked_by = build_profile_link($revoked_user['username'], $revoked_user['uid'], "_blank");
|
$revoke_reason = nl2br(htmlspecialchars_uni($warning['revokereason']));
|
$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->construct_row();
|
$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_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 278 | Zeile 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 311 | Zeile 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 328 | Zeile 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 345 | Zeile 345 |
---|
{ $value = urlencode($value); $url .= "&filter[{$field}]={$value}";
|
{ $value = urlencode($value); $url .= "&filter[{$field}]={$value}";
|
}
| }
|
}
// The actual query
| }
// The actual query
|
Zeile 365 | Zeile 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 374 | Zeile 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']) { $username_link = $username;
|
$trow = alt_trow(); $username = format_name($row['username'], $row['usergroup'], $row['displaygroup']); if(!$row['uid']) { $username_link = $username;
|
}
| }
|
else {
|
else {
|
$username_link = build_profile_link($username, $row['uid']);
| $username_link = build_profile_link($username, $row['uid'], "_blank");
|
} $mod_username = format_name($row['mod_username'], $row['mod_usergroup'], $row['mod_displaygroup']);
|
} $mod_username = format_name($row['mod_username'], $row['mod_usergroup'], $row['mod_displaygroup']);
|
$mod_username_link = build_profile_link($mod_username, $row['mod_uid']);
| $mod_username_link = build_profile_link($mod_username, $row['mod_uid'], "_blank");
|
$issued_date = my_date($mybb->settings['dateformat'], $row['dateline']).' '.my_date($mybb->settings['timeformat'], $row['dateline']); $revoked_text = ''; if($row['daterevoked'] > 0)
| $issued_date = my_date($mybb->settings['dateformat'], $row['dateline']).' '.my_date($mybb->settings['timeformat'], $row['dateline']); $revoked_text = ''; if($row['daterevoked'] > 0)
|
Zeile 408 | Zeile 408 |
---|
else { $expire_date = $lang->never;
|
else { $expire_date = $lang->never;
|
}
| }
|
$title = $row['title']; if(empty($row['title'])) {
| $title = $row['title']; if(empty($row['title'])) {
|
Zeile 419 | Zeile 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 428 | Zeile 428 |
---|
$table->construct_cell("<a href=\"index.php?module=tools-warninglog&action=view&wid={$row['wid']}\">{$lang->view}</a>", array("class" => "align_center")); $table->construct_row(); }
|
$table->construct_cell("<a href=\"index.php?module=tools-warninglog&action=view&wid={$row['wid']}\">{$lang->view}</a>", array("class" => "align_center")); $table->construct_row(); }
|
|
|
if($table->num_rows() == 0) { $table->construct_cell($lang->no_warning_logs, array("colspan" => "6")); $table->construct_row(); }
|
if($table->num_rows() == 0) { $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
|
Zeile 457 | Zeile 457 |
---|
$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(); } ?>
|