$values['id_name']]
);
if ($exists) {
echo 'duplicate';
} else {
$result = db_process_sql_insert('tsesion_filter', $values);
if ($result === false) {
echo 'error';
} else {
echo $result;
}
}
}
if ($recover_aduit_log_select) {
echo json_encode(audit_get_audit_filter_select());
}
if ($update_log_filter) {
$values = [];
$id = get_parameter('id');
$values['text'] = get_parameter('text', '');
$values['period'] = get_parameter('period', '');
$values['ip'] = get_parameter('ip', '');
$values['type'] = get_parameter('type', -1);
$values['user'] = get_parameter('user', -1);
$result = db_process_sql_update(
'tsesion_filter',
$values,
['id_filter' => $id]
);
if ($result === false) {
echo 'error';
} else {
echo 'ok';
}
}
if ($get_filter_values) {
$id_filter = get_parameter('id');
$event_filter = audit_get_audit_log_filter($id_filter);
echo json_encode($event_filter);
}
if ($load_filter_modal) {
$filters = audit_get_audit_filter_select();
$user_groups_array = users_get_groups_for_select(
$config['id_user'],
$access,
true,
true,
false
);
echo '
';
$table = new StdClass;
$table->id = 'load_filter_form';
$table->width = '100%';
$table->cellspacing = 4;
$table->cellpadding = 4;
$table->class = 'databox no_border';
if (is_metaconsole()) {
$table->cellspacing = 0;
$table->cellpadding = 0;
$table->class = 'databox filters no_border';
}
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
$filter_id_width = 'w100p';
$data = [];
$table->rowid[3] = 'update_filter_row1';
$data[0] = __('Load filter').$jump;
$data[0] .= html_print_select(
$filters,
'filter_id',
'',
'',
__('None'),
0,
true,
false,
true,
'',
false,
'margin-left:5px; width:'.$filter_id_width.';'
);
$table->rowclass[] = 'display-grid';
$data[1] = html_print_submit_button(
__('Load filter'),
'load_filter',
false,
[
'class' => 'mini w25p',
'style' => 'margin-left: 73%',
'onclick' => 'load_filter_values();',
],
true
);
$data[1] .= html_print_input_hidden('load_filter', 1, true);
$table->data[] = $data;
$table->rowclass[] = '';
html_print_table($table);
echo '
';
?>
';
if (check_acl($config['id_user'], 0, 'EW') === 1 || check_acl($config['id_user'], 0, 'EM') === 1) {
echo '';
$table = new StdClass;
$table->id = 'save_filter_form';
$table->width = '100%';
$table->cellspacing = 4;
$table->cellpadding = 4;
$table->class = 'databox no_border';
if (is_metaconsole()) {
$table->class = 'databox filters no_border';
$table->cellspacing = 0;
$table->cellpadding = 0;
}
$table->styleTable = 'font-weight: bold; text-align:left;';
if (!is_metaconsole()) {
$table->style[0] = 'width: 50%; width:50%;';
}
$data = [];
$table->rowid[0] = 'update_save_selector';
$data[0] = html_print_radio_button(
'filter_mode',
'new',
__('New filter'),
true,
true
);
$data[1] = html_print_radio_button(
'filter_mode',
'update',
__('Update filter'),
false,
true
);
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$table->rowid[1] = 'save_filter_row1';
$data[0] = __('Filter name').$jump;
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
$data[1] = html_print_submit_button(
__('Save filter'),
'save_filter',
false,
[
'class' => 'mini w25p',
'style' => 'margin-left: 56%',
'onclick' => 'save_new_filter();',
],
true
);
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$table->rowid[2] = 'save_filter_row2';
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$table->rowid[3] = 'update_filter_row1';
$data[0] = __('Overwrite filter').$jump;
$_filters_update = audit_get_audit_filter_select();
$data[0] .= html_print_select(
$_filters_update,
'overwrite_filter',
'',
'',
'',
0,
true
);
$table->rowclass[] = 'display-grid';
$data[1] = html_print_submit_button(
__('Update filter'),
'update_filter',
false,
[
'class' => 'mini w25p',
'style' => 'margin-left: 56%',
'onclick' => 'save_update_filter();',
],
true
);
$table->data[] = $data;
$table->rowclass[] = '';
html_print_table($table);
} else {
include 'general/noaccess.php';
}
echo '';
?>