mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
2013-06-05 Miguel de Dios <miguel.dedios@artica.es>
* operation/snmpconsole/snmp_view.php: fixed the pagination. Fixes: #2255 * godmode/groups/group_list.php, godmode/agentes/agent_manager.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8256 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
dd6c1cc7be
commit
1e74f905f5
@ -1,3 +1,12 @@
|
|||||||
|
2013-06-05 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* operation/snmpconsole/snmp_view.php: fixed the pagination.
|
||||||
|
|
||||||
|
Fixes: #2255
|
||||||
|
|
||||||
|
* godmode/groups/group_list.php, godmode/agentes/agent_manager.php:
|
||||||
|
cleaned source code style.
|
||||||
|
|
||||||
2013-06-04 Miguel de Dios <miguel.dedios@artica.es>
|
2013-06-04 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* godmode/agentes/agent_manager.php, godmode/menu.php,
|
* godmode/agentes/agent_manager.php, godmode/menu.php,
|
||||||
|
@ -243,14 +243,19 @@ $table->data[0][0] = __('Custom ID');
|
|||||||
$table->data[0][1] = html_print_input_text ('custom_id', $custom_id, '', 16, 255, true);
|
$table->data[0][1] = html_print_input_text ('custom_id', $custom_id, '', 16, 255, true);
|
||||||
|
|
||||||
// Learn mode / Normal mode
|
// Learn mode / Normal mode
|
||||||
$table->data[1][0] = __('Module definition').ui_print_help_icon("module_definition", true);
|
$table->data[1][0] = __('Module definition') .
|
||||||
$table->data[1][1] = __('Learning mode').' '.html_print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"', true);
|
ui_print_help_icon("module_definition", true);
|
||||||
$table->data[1][1] .= __('Normal mode').' '.html_print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"', true);
|
$table->data[1][1] = __('Learning mode') . ' ' .
|
||||||
|
html_print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"', true);
|
||||||
|
$table->data[1][1] .= __('Normal mode') . ' ' .
|
||||||
|
html_print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"', true);
|
||||||
|
|
||||||
// Status (Disabled / Enabled)
|
// Status (Disabled / Enabled)
|
||||||
$table->data[2][0] = __('Status');
|
$table->data[2][0] = __('Status');
|
||||||
$table->data[2][1] = __('Disabled').' '.html_print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
$table->data[2][1] = __('Disabled') . ' ' .
|
||||||
$table->data[2][1] .= __('Active').' '.html_print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
html_print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
||||||
|
$table->data[2][1] .= __('Active') . ' ' .
|
||||||
|
html_print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
||||||
|
|
||||||
// Remote configuration
|
// Remote configuration
|
||||||
$table->data[3][0] = __('Remote configuration');
|
$table->data[3][0] = __('Remote configuration');
|
||||||
@ -261,7 +266,8 @@ if (!$new_agent) {
|
|||||||
// Delete remote configuration
|
// Delete remote configuration
|
||||||
$table->data[3][1] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&disk_conf_delete=1&id_agente='.$id_agente.'">';
|
$table->data[3][1] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&disk_conf_delete=1&id_agente='.$id_agente.'">';
|
||||||
$table->data[3][1] .= html_print_image ("images/cross.png", true, array ('title' => __('Delete remote configuration file'), 'style' => 'vertical-align: middle;')).'</a>';
|
$table->data[3][1] .= html_print_image ("images/cross.png", true, array ('title' => __('Delete remote configuration file'), 'style' => 'vertical-align: middle;')).'</a>';
|
||||||
$table->data[3][1] .= '</a>'.ui_print_help_tip (__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), true);
|
$table->data[3][1] .= '</a>' .
|
||||||
|
ui_print_help_tip (__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$table->data[3][1] = '<em>' . __('Not available') . '</em>';
|
$table->data[3][1] = '<em>' . __('Not available') . '</em>';
|
||||||
@ -354,7 +360,7 @@ if (!empty($fields)) {
|
|||||||
ui_toggle(html_print_table ($table, true), __('Custom fields'));
|
ui_toggle(html_print_table ($table, true), __('Custom fields'));
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
echo '<div class="action-buttons" style="width: ' . $table->width . '">';
|
||||||
if ($id_agente) {
|
if ($id_agente) {
|
||||||
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
|
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||||
html_print_input_hidden ('update_agent', 1);
|
html_print_input_hidden ('update_agent', 1);
|
||||||
|
@ -188,7 +188,7 @@ if ($update_group) {
|
|||||||
$other = (string) get_parameter ('other');
|
$other = (string) get_parameter ('other');
|
||||||
|
|
||||||
/*Check if name field is empty*/
|
/*Check if name field is empty*/
|
||||||
if( $name != "") {
|
if ( $name != "") {
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$sql = sprintf ('UPDATE tgrupo SET nombre = "%s",
|
$sql = sprintf ('UPDATE tgrupo SET nombre = "%s",
|
||||||
|
@ -59,7 +59,7 @@ ui_print_page_header (__("SNMP Console"), "images/op_snmp.png", false, "", false
|
|||||||
// OPERATIONS
|
// OPERATIONS
|
||||||
|
|
||||||
// Delete SNMP Trap entry Event (only incident management access).
|
// Delete SNMP Trap entry Event (only incident management access).
|
||||||
if (isset ($_GET["delete"])){
|
if (isset ($_GET["delete"])) {
|
||||||
$id_trap = (int) get_parameter_get ("delete", 0);
|
$id_trap = (int) get_parameter_get ("delete", 0);
|
||||||
if ($id_trap > 0 && check_acl ($config['id_user'], 0, "IM")) {
|
if ($id_trap > 0 && check_acl ($config['id_user'], 0, "IM")) {
|
||||||
|
|
||||||
@ -124,16 +124,27 @@ if (isset ($_POST["updatebt"])) {
|
|||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$sql = sprintf ("SELECT * FROM ttrap ORDER BY timestamp DESC LIMIT %d,%d",$offset,$pagination);
|
$sql = sprintf ("
|
||||||
|
SELECT *
|
||||||
|
FROM ttrap
|
||||||
|
ORDER BY timestamp DESC
|
||||||
|
LIMIT %d,%d",$offset,$pagination);
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$sql = sprintf ("SELECT * FROM ttrap ORDER BY timestamp DESC LIMIT %d OFFSET %d", $pagination, $offset);
|
$sql = sprintf ("
|
||||||
|
SELECT *
|
||||||
|
FROM ttrap
|
||||||
|
ORDER BY timestamp DESC
|
||||||
|
LIMIT %d OFFSET %d", $pagination, $offset);
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$set = array();
|
$set = array();
|
||||||
$set['limit'] = $pagination;
|
$set['limit'] = $pagination;
|
||||||
$set['offset'] = $offset;
|
$set['offset'] = $offset;
|
||||||
$sql = sprintf ("SELECT * FROM ttrap ORDER BY timestamp DESC");
|
$sql = sprintf ("
|
||||||
|
SELECT *
|
||||||
|
FROM ttrap
|
||||||
|
ORDER BY timestamp DESC");
|
||||||
$sql = oracle_recode_query ($sql, $set);
|
$sql = oracle_recode_query ($sql, $set);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -176,13 +187,24 @@ foreach ($all_traps as $trap) {
|
|||||||
//Make query to extract traps of DB.
|
//Make query to extract traps of DB.
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$sql = "SELECT * FROM ttrap %s ORDER BY timestamp DESC LIMIT %d,%d";
|
$sql = "
|
||||||
|
SELECT *
|
||||||
|
FROM ttrap %s
|
||||||
|
ORDER BY timestamp DESC
|
||||||
|
LIMIT %d,%d";
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$sql = "SELECT * FROM ttrap %s ORDER BY timestamp DESC LIMIT %d OFFSET %d";
|
$sql = "
|
||||||
|
SELECT *
|
||||||
|
FROM ttrap %s
|
||||||
|
ORDER BY timestamp DESC
|
||||||
|
LIMIT %d OFFSET %d";
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$sql = "SELECT * FROM ttrap %s ORDER BY timestamp DESC";
|
$sql = "
|
||||||
|
SELECT *
|
||||||
|
FROM ttrap %s
|
||||||
|
ORDER BY timestamp DESC";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$whereSubquery = 'WHERE 1=1';
|
$whereSubquery = 'WHERE 1=1';
|
||||||
@ -366,12 +388,25 @@ ui_toggle($filter, __('Toggle filter(s)'));
|
|||||||
unset ($table);
|
unset ($table);
|
||||||
|
|
||||||
// Prepare index for pagination
|
// Prepare index for pagination
|
||||||
$trapcount = db_get_sql ("SELECT COUNT(id_trap) FROM ttrap " . $whereSubquery);
|
$trapcount = db_get_sql ("
|
||||||
|
SELECT COUNT(id_trap)
|
||||||
|
FROM ttrap " .
|
||||||
|
$whereSubquery);
|
||||||
|
|
||||||
$urlPagination = "index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&filter_agent=" . $filter_agent
|
$urlPagination = "index.php?" .
|
||||||
. "&filter_oid=" . $filter_oid . "&filter_severity=" . $filter_severity
|
"sec=estado&" .
|
||||||
. "&filter_fired=" . $filter_fired . "&filter_status=" . $filter_status
|
"sec2=operation/snmpconsole/snmp_view&" .
|
||||||
. "&search_string=" . $search_string . "&pagination=".$pagination."&offset=".$offset."&refr=".((int)get_parameter('refr', 0))."&pure=".$config["pure"];
|
"filter_agent=" . $filter_agent . "&" .
|
||||||
|
"filter_oid=" . $filter_oid . "&" .
|
||||||
|
"filter_severity=" . $filter_severity . "&" .
|
||||||
|
"filter_fired=" . $filter_fired . "&" .
|
||||||
|
"filter_status=" . $filter_status . "&" .
|
||||||
|
"search_string=" . $search_string . "&" .
|
||||||
|
"pagination=" . $pagination . "&" .
|
||||||
|
"offset=" . $offset . "&" .
|
||||||
|
"refr=" . ((int)get_parameter('refr', 0)) . "&" .
|
||||||
|
"pure=" . $config["pure"] . "&" .
|
||||||
|
"search_string=" . $search_string;
|
||||||
ui_pagination ($trapcount, $urlPagination, $offset, $pagination);
|
ui_pagination ($trapcount, $urlPagination, $offset, $pagination);
|
||||||
|
|
||||||
echo '<form name="eventtable" method="POST" action="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pagination='.$pagination.'&offset='.$offset.'">';
|
echo '<form name="eventtable" method="POST" action="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pagination='.$pagination.'&offset='.$offset.'">';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user