Skip to content

Commit 0bb3a94

Browse files
committed
updates to abuse admin
1 parent 718e65e commit 0bb3a94

1 file changed

Lines changed: 2 additions & 58 deletions

File tree

src/abuse_admin.php

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -90,64 +90,8 @@ function_requirements('has_acl');
9090
add_output($table2->get_table());
9191

9292
if (isset($lid)) {
93-
$db->query("select * from abuse left join abuse_data using (abuse_id) where abuse_lid='{$lid}'");
94-
$rows = [];
95-
while ($db->next_record(MYSQL_ASSOC)) {
96-
unset($db->Record['abuse_lid']);
97-
if (!isset($header)) {
98-
$header = array_keys($db->Record);
99-
foreach ($header as $idx => $field) {
100-
$header[$idx] = ucwords(str_replace('abuse_', '', $field));
101-
}
102-
}
103-
$headerlimit = 50;
104-
$db->Record['abuse_headers'] = (mb_strlen($db->Record['abuse_headers']) <= $headerlimit ? $db->Record['abuse_headers'] : '<a href="'.$GLOBALS['tf']->link('index.php', 'choice=none.abuse&lid='.$lid.'&id='.$db->Record['abuse_id']).'" class="btn" data-toggle="popover" data-trigger="hover" data-placement="bottom" '.(stripos($db->Record['abuse_headers'], '<html>') === false ? 'data-html="true" data-content="'.htmlentities(nl2br($db->Record['abuse_headers']), ENT_QUOTES, 'UTF-8').'"' : 'data-html="true" data-content="'.htmlentities($db->Record['abuse_headers'], ENT_QUOTES, 'UTF-8').'"').'>'.mb_substr($db->Record['abuse_headers'], 0, $headerlimit).'...</a>');
105-
$rows[] = $db->Record;
106-
if (isset($GLOBALS['tf']->variables->request['id']) && $GLOBALS['tf']->variables->request['id'] == $db->Record['abuse_id']) {
107-
$table = new \TFTable;
108-
$table->set_title('Abuse '.$db->Record['abuse_id'].' Entry');
109-
foreach ($db->Record as $key => $value) {
110-
$table->add_field($key);
111-
$table->add_field(htmlspecial($value));
112-
$table->add_row();
113-
}
114-
add_output($table->get_table());
115-
}
116-
}
117-
$GLOBALS['tf']->add_html_head_js_string('
118-
jQuery(document).ready(function () {
119-
jQuery("[data-toggle=popover]").popover();
120-
//jQuery("[data-toggle=tooltip]").tooltip();
121-
});
122-
');
123-
$GLOBALS['tf']->add_html_head_css_file('
124-
.tablesorter>body>tr>td {
125-
opacity: 1;
126-
}
127-
.tablesorter-jui tbody>tr.hover>td,
128-
.tablesorter-jui tbody>tr:hover>td {
129-
opacity: 1;
130-
filter: alpha(opacity=100);
131-
}
132-
div.popover {
133-
max-width: 850px;
134-
overflow: scroll;
135-
}
136-
div.tooltip {
137-
width: 500px;
138-
height: 300px;
139-
}
140-
');
141-
add_js('tablesorter');
142-
$smarty = new \TFSmarty;
143-
$smarty->debugging = true;
144-
$smarty->assign('sortcol', 0);
145-
$smarty->assign('sortdir', 1);
146-
$smarty->assign('size', 10);
147-
$smarty->assign('textextraction', "'complex'");
148-
$smarty->assign('table_header', $header);
149-
$smarty->assign('table_rows', $rows);
150-
add_output(str_replace(['mainelement', 'itemtable', 'itempager'], [$module.'abusemainelement', $module.'abusetable', $module.'abusepager'], $smarty->fetch('tablesorter/tablesorter.tpl')));
93+
function_requirements('crud_abuse');
94+
crud_abuse();
15195
}
15296
if (isset($GLOBALS['tf']->variables->request['headers']) && verify_csrf('abuse_admin')) {
15397
$ip = $GLOBALS['tf']->variables->request['ip'];

0 commit comments

Comments
 (0)