mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
2012-06-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/styles/pandora_minimal.css operation/extensions.php operation/menu.php general/header.php godmode/extensions.php: Hide not valid sections with metaconsole activated. Merged from branches. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6443 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a3d94759dd
commit
005a738ee3
@ -1,3 +1,14 @@
|
|||||||
|
2012-06-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
|
* include/styles/pandora_minimal.css
|
||||||
|
operation/extensions.php
|
||||||
|
operation/menu.php
|
||||||
|
general/header.php
|
||||||
|
godmode/extensions.php: Hide not valid sections with metaconsole
|
||||||
|
activated.
|
||||||
|
|
||||||
|
Merged from branches.
|
||||||
|
|
||||||
2012-06-07 Dario Rodriguez <dario.rodriguez@artica.es>
|
2012-06-07 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||||
|
|
||||||
* include/functions_os.php: Created this file.
|
* include/functions_os.php: Created this file.
|
||||||
|
@ -92,7 +92,13 @@ config_check();
|
|||||||
// Main help icon
|
// Main help icon
|
||||||
echo " ";
|
echo " ";
|
||||||
echo " ";
|
echo " ";
|
||||||
echo ui_print_help_icon ("main_help", true);
|
echo ui_print_help_icon ("main_help", true);
|
||||||
|
if ($config['metaconsole'] == 1) {
|
||||||
|
echo " ";
|
||||||
|
echo " ";
|
||||||
|
html_print_image("images/application_double.png", false, array("alt" => __('Metaconsole activated'), "class" => 'bot', "title" => __('You are using metaconsole')));
|
||||||
|
}
|
||||||
|
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
echo '<td width="20%">';
|
echo '<td width="20%">';
|
||||||
|
|
||||||
@ -117,10 +123,7 @@ config_check();
|
|||||||
unset ($servers); // Since this is the header, we don't like to trickle down variables.
|
unset ($servers); // Since this is the header, we don't like to trickle down variables.
|
||||||
echo '</a>';
|
echo '</a>';
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// TODO: Put here to remark this is a metaconsole
|
|
||||||
echo "";
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td width="20%">
|
<td width="20%">
|
||||||
|
@ -258,6 +258,14 @@ foreach ($extensions as $file => $extension) {
|
|||||||
' <a title="' . __('Disable') . '" href="index.php?sec=gextensions&sec2=godmode/extensions&enterprise=' . (int)$extension['enterprise'] . '&disabled='.$file.'" class="mn">' . html_print_image("images/lightbulb.png", true) . '</a>';
|
' <a title="' . __('Disable') . '" href="index.php?sec=gextensions&sec2=godmode/extensions&enterprise=' . (int)$extension['enterprise'] . '&disabled='.$file.'" class="mn">' . html_print_image("images/lightbulb.png", true) . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filter operation and godmode extensions not included in metaconsole
|
||||||
|
if ($config['metaconsole'] == 1) {
|
||||||
|
if (!empty($config['extensions'][$file]['operation_menu']['fatherId']) and !array_key_exists($config['extensions'][$file]['operation_menu']['fatherId'], $operation_menu_array))
|
||||||
|
continue;
|
||||||
|
if (!empty($config['extensions'][$file]['godmode_menu']['fatherId']) and !array_key_exists($config['extensions'][$file]['godmode_menu']['fatherId'], $menu))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$table->data[] = $data;
|
$table->data[] = $data;
|
||||||
}
|
}
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
|
@ -181,4 +181,25 @@ input.next {
|
|||||||
padding-right: 21px;
|
padding-right: 21px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info_box {
|
||||||
|
background: #EBEBEB;
|
||||||
|
margin: 10px auto;
|
||||||
|
padding: 5px;
|
||||||
|
border: 1px solid #A8A8A8;
|
||||||
|
width: 85% !important;
|
||||||
|
-moz-box-shadow: 0px 2px 2px #010E1B !important;
|
||||||
|
-webkit-box-shadow: 0px 2px 2px #010E1B !important;
|
||||||
|
box-shadow: 0px 2px 2px #010E1B !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info_box .title * {
|
||||||
|
font-size: 10pt !important;
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info_box .icon {
|
||||||
|
width: 30px !important;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,7 +55,13 @@ foreach ($config['extensions'] as $extension) {
|
|||||||
continue;
|
continue;
|
||||||
if ($extension['operation_menu'] == null)
|
if ($extension['operation_menu'] == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// If metaconsole is activated skip extensions without fatherID in menu array (this sections and extensions are filtered in metaconsole mode)
|
||||||
|
if ($config['metaconsole'] == 1) {
|
||||||
|
if (!empty($extension['operation_menu']['fatherId']) and !array_key_exists($extension['operation_menu']['fatherId'], $operation_menu_array))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$data = array ();
|
$data = array ();
|
||||||
$data[0] = $extension['operation_menu']['name'];
|
$data[0] = $extension['operation_menu']['name'];
|
||||||
$data[1] = '<a href="index.php?sec=extensions&sec2='.$extension['operation_menu']['sec2'].'" class="mn">' . __('Execute') . '</a>';
|
$data[1] = '<a href="index.php?sec=extensions&sec2='.$extension['operation_menu']['sec2'].'" class="mn">' . __('Execute') . '</a>';
|
||||||
|
@ -30,79 +30,83 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||||||
|
|
||||||
enterprise_hook ('metaconsole_menu');
|
enterprise_hook ('metaconsole_menu');
|
||||||
|
|
||||||
//View agents
|
if ($config['metaconsole'] == 0) {
|
||||||
$menu["estado"]["text"] = __('Monitoring');
|
//View agents
|
||||||
$menu["estado"]["sec2"] = "operation/agentes/tactical";
|
$menu["estado"]["text"] = __('Monitoring');
|
||||||
$menu["estado"]["refr"] = 0;
|
$menu["estado"]["sec2"] = "operation/agentes/tactical";
|
||||||
$menu["estado"]["id"] = "oper-agents";
|
$menu["estado"]["refr"] = 0;
|
||||||
|
$menu["estado"]["id"] = "oper-agents";
|
||||||
$sub = array ();
|
|
||||||
$sub["operation/agentes/tactical"]["text"] = __('Tactical view');
|
|
||||||
$sub["operation/agentes/tactical"]["refr"] = 0;
|
|
||||||
|
|
||||||
$sub["operation/agentes/group_view"]["text"] = __('Group view');
|
$sub = array ();
|
||||||
$sub["operation/agentes/group_view"]["refr"] = 0;
|
$sub["operation/agentes/tactical"]["text"] = __('Tactical view');
|
||||||
|
$sub["operation/agentes/tactical"]["refr"] = 0;
|
||||||
$sub["operation/agentes/estado_agente"]["text"] = __('Agent detail');
|
|
||||||
$sub["operation/agentes/estado_agente"]["refr"] = 0;
|
$sub["operation/agentes/group_view"]["text"] = __('Group view');
|
||||||
$sub["operation/agentes/estado_agente"]["subsecs"] = array(
|
$sub["operation/agentes/group_view"]["refr"] = 0;
|
||||||
"operation/agentes/ver_agente");
|
|
||||||
|
$sub["operation/agentes/estado_agente"]["text"] = __('Agent detail');
|
||||||
$sub["operation/agentes/alerts_status"]["text"] = __('Alert detail');
|
$sub["operation/agentes/estado_agente"]["refr"] = 0;
|
||||||
$sub["operation/agentes/alerts_status"]["refr"] = 0;
|
$sub["operation/agentes/estado_agente"]["subsecs"] = array(
|
||||||
|
"operation/agentes/ver_agente");
|
||||||
$sub["operation/agentes/status_monitor"]["text"] = __('Monitor detail');
|
|
||||||
$sub["operation/agentes/status_monitor"]["refr"] = 0;
|
$sub["operation/agentes/alerts_status"]["text"] = __('Alert detail');
|
||||||
|
$sub["operation/agentes/alerts_status"]["refr"] = 0;
|
||||||
enterprise_hook ('services_menu');
|
|
||||||
|
$sub["operation/agentes/status_monitor"]["text"] = __('Monitor detail');
|
||||||
enterprise_hook ('inventory_menu');
|
$sub["operation/agentes/status_monitor"]["refr"] = 0;
|
||||||
|
|
||||||
$sub["operation/servers/recon_view"]["text"] = __('Recon view');
|
enterprise_hook ('services_menu');
|
||||||
$sub["operation/servers/recon_view"]["refr"] = 0;
|
|
||||||
|
enterprise_hook ('inventory_menu');
|
||||||
|
|
||||||
//SNMP Console
|
$sub["operation/servers/recon_view"]["text"] = __('Recon view');
|
||||||
$sub["operation/snmpconsole/snmp_view"]["text"] = __('SNMP console');
|
$sub["operation/servers/recon_view"]["refr"] = 0;
|
||||||
$sub["operation/snmpconsole/snmp_view"]["refr"] = 0;
|
|
||||||
$sub["operation/snmpconsole/snmp_view"]["subsecs"] = array(
|
|
||||||
"enterprise/godmode/snmpconsole",
|
//SNMP Console
|
||||||
"godmode/snmpconsole/snmp_trap_editor",
|
$sub["operation/snmpconsole/snmp_view"]["text"] = __('SNMP console');
|
||||||
"godmode/snmpconsole/snmp_alert",
|
$sub["operation/snmpconsole/snmp_view"]["refr"] = 0;
|
||||||
"godmode/snmpconsole/snmp_filters",
|
$sub["operation/snmpconsole/snmp_view"]["subsecs"] = array(
|
||||||
"godmode/snmpconsole/snmp_trap_generator");
|
"enterprise/godmode/snmpconsole",
|
||||||
|
"godmode/snmpconsole/snmp_trap_editor",
|
||||||
$sub2 = array();
|
"godmode/snmpconsole/snmp_alert",
|
||||||
|
"godmode/snmpconsole/snmp_filters",
|
||||||
$sub2["godmode/snmpconsole/snmp_alert"]["text"] = __("SNMP alerts");
|
"godmode/snmpconsole/snmp_trap_generator");
|
||||||
$sub2['godmode/snmpconsole/snmp_filters']['text'] = __('SNMP filters');
|
|
||||||
enterprise_hook ('snmpconsole_submenu');
|
$sub2 = array();
|
||||||
$sub2['godmode/snmpconsole/snmp_trap_generator']['text'] = __('SNMP trap generator');
|
|
||||||
|
$sub2["godmode/snmpconsole/snmp_alert"]["text"] = __("SNMP alerts");
|
||||||
|
$sub2['godmode/snmpconsole/snmp_filters']['text'] = __('SNMP filters');
|
||||||
|
enterprise_hook ('snmpconsole_submenu');
|
||||||
|
$sub2['godmode/snmpconsole/snmp_trap_generator']['text'] = __('SNMP trap generator');
|
||||||
|
|
||||||
$sub["operation/snmpconsole/snmp_view"]["sub2"] = $sub2;
|
$sub["operation/snmpconsole/snmp_view"]["sub2"] = $sub2;
|
||||||
|
|
||||||
$sub['operation/tree']['text'] = __('Tree view');
|
|
||||||
$sub["operation/tree"]["refr"] = 0;
|
|
||||||
|
|
||||||
$menu["estado"]["sub"] = $sub;
|
$sub['operation/tree']['text'] = __('Tree view');
|
||||||
//End of view agents
|
$sub["operation/tree"]["refr"] = 0;
|
||||||
|
|
||||||
|
$menu["estado"]["sub"] = $sub;
|
||||||
|
//End of view agents
|
||||||
|
}
|
||||||
|
|
||||||
//Start network view
|
if ($config['metaconsole'] == 0) {
|
||||||
|
//Start network view
|
||||||
$menu["network"]["text"] = __('Network View');
|
|
||||||
$menu["network"]["sec2"] = "operation/agentes/networkmap_list";
|
$menu["network"]["text"] = __('Network View');
|
||||||
$menu["network"]["refr"] = 0;
|
$menu["network"]["sec2"] = "operation/agentes/networkmap_list";
|
||||||
$menu["network"]["id"] = "oper-networkconsole";
|
$menu["network"]["refr"] = 0;
|
||||||
|
$menu["network"]["id"] = "oper-networkconsole";
|
||||||
$sub = array();
|
|
||||||
|
$sub = array();
|
||||||
$sub["operation/agentes/networkmap_list"]["text"] = __('Network map');
|
|
||||||
$sub["operation/agentes/networkmap_list"]["refr"] = 0;
|
$sub["operation/agentes/networkmap_list"]["text"] = __('Network map');
|
||||||
|
$sub["operation/agentes/networkmap_list"]["refr"] = 0;
|
||||||
enterprise_hook ('networkmap_console');
|
|
||||||
|
enterprise_hook ('networkmap_console');
|
||||||
$menu["network"]["sub"] = $sub;
|
|
||||||
//End networkview
|
$menu["network"]["sub"] = $sub;
|
||||||
|
//End networkview
|
||||||
|
}
|
||||||
|
|
||||||
// Reporting
|
// Reporting
|
||||||
$menu["reporting"]["text"] = __('Reporting');
|
$menu["reporting"]["text"] = __('Reporting');
|
||||||
@ -172,25 +176,28 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sub["godmode/reporting/map_builder"]["sub2"] = $sub2;
|
if ($config['metaconsole'] == 0) {
|
||||||
|
$sub["godmode/reporting/map_builder"]["sub2"] = $sub2;
|
||||||
$sub["godmode/reporting/graphs"]["text"] = __('Custom graphs');
|
|
||||||
//Set godomode path
|
$sub["godmode/reporting/graphs"]["text"] = __('Custom graphs');
|
||||||
$sub["godmode/reporting/graphs"]["subsecs"] = array(
|
//Set godomode path
|
||||||
"operation/reporting/graph_viewer",
|
$sub["godmode/reporting/graphs"]["subsecs"] = array(
|
||||||
"godmode/reporting/graph_builder");
|
"operation/reporting/graph_viewer",
|
||||||
|
"godmode/reporting/graph_builder");
|
||||||
|
|
||||||
|
$sub["operation/agentes/exportdata"]["text"] = __('Export data');
|
||||||
|
$sub["operation/agentes/exportdata"]["subsecs"] = array("operation/agentes/exportdata");
|
||||||
|
|
||||||
$sub["operation/agentes/exportdata"]["text"] = __('Export data');
|
enterprise_hook ('dashboard_menu');
|
||||||
$sub["operation/agentes/exportdata"]["subsecs"] = array("operation/agentes/exportdata");
|
enterprise_hook ('reporting_godmenu');
|
||||||
|
}
|
||||||
enterprise_hook ('dashboard_menu');
|
|
||||||
enterprise_hook ('reporting_godmenu');
|
|
||||||
|
|
||||||
$menu["reporting"]["sub"] = $sub;
|
$menu["reporting"]["sub"] = $sub;
|
||||||
//End reporting
|
//End reporting
|
||||||
|
|
||||||
|
|
||||||
//INI GIS Maps
|
//INI GIS Maps
|
||||||
if ($config['activate_gis']) {
|
if ($config['activate_gis'] and ($config['metaconsole'] == 0)) {
|
||||||
$menu["gismaps"]["text"] = __('GIS Maps');
|
$menu["gismaps"]["text"] = __('GIS Maps');
|
||||||
$menu["gismaps"]["sec2"] = "operation/gis_maps/index";
|
$menu["gismaps"]["sec2"] = "operation/gis_maps/index";
|
||||||
$menu["gismaps"]["refr"] = 0;
|
$menu["gismaps"]["refr"] = 0;
|
||||||
@ -229,7 +236,7 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Rest of options, all with AR privilege (or should events be with incidents?)
|
// Rest of options, all with AR privilege (or should events be with incidents?)
|
||||||
if (check_acl ($config['id_user'], 0, "AR")) {
|
if (check_acl ($config['id_user'], 0, "AR") and ($config['metaconsole'] == 0)) {
|
||||||
// Events
|
// Events
|
||||||
$menu["eventos"]["text"] = __('View events');
|
$menu["eventos"]["text"] = __('View events');
|
||||||
$menu["eventos"]["refr"] = 0;
|
$menu["eventos"]["refr"] = 0;
|
||||||
@ -332,7 +339,7 @@ $menu["workspace"]["sub"] = $sub;
|
|||||||
|
|
||||||
//End Workspace
|
//End Workspace
|
||||||
|
|
||||||
if (check_acl ($config['id_user'], 0, "IR")) {
|
if (check_acl ($config['id_user'], 0, "IR") and ($config['metaconsole'] == 0)) {
|
||||||
if ($config['activate_netflow']) {
|
if ($config['activate_netflow']) {
|
||||||
$menu["netf"]["text"] = __('Netflow');
|
$menu["netf"]["text"] = __('Netflow');
|
||||||
$menu["netf"]["sec2"] = "operation/netflow/nf_reporting";
|
$menu["netf"]["sec2"] = "operation/netflow/nf_reporting";
|
||||||
@ -345,11 +352,13 @@ if (check_acl ($config['id_user'], 0, "IR")) {
|
|||||||
// Rest of options, all with AR privilege (or should events be with incidents?)
|
// Rest of options, all with AR privilege (or should events be with incidents?)
|
||||||
if (check_acl ($config['id_user'], 0, "AR")) {
|
if (check_acl ($config['id_user'], 0, "AR")) {
|
||||||
|
|
||||||
//SNMP Console
|
if ($config['metaconsole'] == 0) {
|
||||||
$menu["snmpconsole"]["text"] = __('SNMP console');
|
//SNMP Console
|
||||||
$menu["snmpconsole"]["refr"] = 0;
|
$menu["snmpconsole"]["text"] = __('SNMP console');
|
||||||
$menu["snmpconsole"]["sec2"] = "operation/snmpconsole/snmp_view";
|
$menu["snmpconsole"]["refr"] = 0;
|
||||||
$menu["snmpconsole"]["id"] = "oper-snmpc";
|
$menu["snmpconsole"]["sec2"] = "operation/snmpconsole/snmp_view";
|
||||||
|
$menu["snmpconsole"]["id"] = "oper-snmpc";
|
||||||
|
}
|
||||||
|
|
||||||
// Extensions menu additions
|
// Extensions menu additions
|
||||||
if (is_array ($config['extensions'])) {
|
if (is_array ($config['extensions'])) {
|
||||||
@ -374,7 +383,8 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (array_key_exists('fatherId',$extension_menu)) {
|
if (array_key_exists('fatherId',$extension_menu)) {
|
||||||
if (strlen($extension_menu['fatherId']) > 0) {
|
// Check that extension father ID exists previously on the menu
|
||||||
|
if ((strlen($extension_menu['fatherId']) > 0) and (($config['metaconsole'] == 0) or (array_key_exists($extension_menu['fatherId'], $menu)))) {
|
||||||
$menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']);
|
$menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']);
|
||||||
$menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["refr"] = 0;
|
$menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["refr"] = 0;
|
||||||
$menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["icon"] = $extension_menu['icon'];
|
$menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["icon"] = $extension_menu['icon'];
|
||||||
@ -391,6 +401,8 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save operation menu array to use in operation/extensions.php view
|
||||||
|
$operation_menu_array = $menu;
|
||||||
|
|
||||||
menu_print_menu ($menu, true);
|
menu_print_menu ($menu, true);
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user