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:
juanmanuelr 2012-06-07 14:22:38 +00:00
parent a3d94759dd
commit 005a738ee3
6 changed files with 158 additions and 97 deletions

View File

@ -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>
* include/functions_os.php: Created this file.

View File

@ -92,7 +92,13 @@ config_check();
// Main help icon
echo "&nbsp;";
echo "&nbsp;";
echo ui_print_help_icon ("main_help", true);
echo ui_print_help_icon ("main_help", true);
if ($config['metaconsole'] == 1) {
echo "&nbsp;";
echo "&nbsp;";
html_print_image("images/application_double.png", false, array("alt" => __('Metaconsole activated'), "class" => 'bot', "title" => __('You are using metaconsole')));
}
echo '</td>';
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.
echo '</a>';
}
else {
// TODO: Put here to remark this is a metaconsole
echo "";
}
?>
</td>
<td width="20%">

View File

@ -258,6 +258,14 @@ foreach ($extensions as $file => $extension) {
' <a title="' . __('Disable') . '" href="index.php?sec=gextensions&amp;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;
}
html_print_table ($table);

View File

@ -181,4 +181,25 @@ input.next {
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;
}

View File

@ -55,7 +55,13 @@ foreach ($config['extensions'] as $extension) {
continue;
if ($extension['operation_menu'] == null)
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[0] = $extension['operation_menu']['name'];
$data[1] = '<a href="index.php?sec=extensions&amp;sec2='.$extension['operation_menu']['sec2'].'" class="mn">' . __('Execute') . '</a>';

View File

@ -30,79 +30,83 @@ if (check_acl ($config['id_user'], 0, "AR")) {
enterprise_hook ('metaconsole_menu');
//View agents
$menu["estado"]["text"] = __('Monitoring');
$menu["estado"]["sec2"] = "operation/agentes/tactical";
$menu["estado"]["refr"] = 0;
$menu["estado"]["id"] = "oper-agents";
$sub = array ();
$sub["operation/agentes/tactical"]["text"] = __('Tactical view');
$sub["operation/agentes/tactical"]["refr"] = 0;
if ($config['metaconsole'] == 0) {
//View agents
$menu["estado"]["text"] = __('Monitoring');
$menu["estado"]["sec2"] = "operation/agentes/tactical";
$menu["estado"]["refr"] = 0;
$menu["estado"]["id"] = "oper-agents";
$sub["operation/agentes/group_view"]["text"] = __('Group view');
$sub["operation/agentes/group_view"]["refr"] = 0;
$sub["operation/agentes/estado_agente"]["text"] = __('Agent detail');
$sub["operation/agentes/estado_agente"]["refr"] = 0;
$sub["operation/agentes/estado_agente"]["subsecs"] = array(
"operation/agentes/ver_agente");
$sub["operation/agentes/alerts_status"]["text"] = __('Alert detail');
$sub["operation/agentes/alerts_status"]["refr"] = 0;
$sub["operation/agentes/status_monitor"]["text"] = __('Monitor detail');
$sub["operation/agentes/status_monitor"]["refr"] = 0;
enterprise_hook ('services_menu');
enterprise_hook ('inventory_menu');
$sub["operation/servers/recon_view"]["text"] = __('Recon view');
$sub["operation/servers/recon_view"]["refr"] = 0;
//SNMP Console
$sub["operation/snmpconsole/snmp_view"]["text"] = __('SNMP console');
$sub["operation/snmpconsole/snmp_view"]["refr"] = 0;
$sub["operation/snmpconsole/snmp_view"]["subsecs"] = array(
"enterprise/godmode/snmpconsole",
"godmode/snmpconsole/snmp_trap_editor",
"godmode/snmpconsole/snmp_alert",
"godmode/snmpconsole/snmp_filters",
"godmode/snmpconsole/snmp_trap_generator");
$sub2 = array();
$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 = array ();
$sub["operation/agentes/tactical"]["text"] = __('Tactical view');
$sub["operation/agentes/tactical"]["refr"] = 0;
$sub["operation/agentes/group_view"]["text"] = __('Group view');
$sub["operation/agentes/group_view"]["refr"] = 0;
$sub["operation/agentes/estado_agente"]["text"] = __('Agent detail');
$sub["operation/agentes/estado_agente"]["refr"] = 0;
$sub["operation/agentes/estado_agente"]["subsecs"] = array(
"operation/agentes/ver_agente");
$sub["operation/agentes/alerts_status"]["text"] = __('Alert detail');
$sub["operation/agentes/alerts_status"]["refr"] = 0;
$sub["operation/agentes/status_monitor"]["text"] = __('Monitor detail');
$sub["operation/agentes/status_monitor"]["refr"] = 0;
enterprise_hook ('services_menu');
enterprise_hook ('inventory_menu');
$sub["operation/servers/recon_view"]["text"] = __('Recon view');
$sub["operation/servers/recon_view"]["refr"] = 0;
//SNMP Console
$sub["operation/snmpconsole/snmp_view"]["text"] = __('SNMP console');
$sub["operation/snmpconsole/snmp_view"]["refr"] = 0;
$sub["operation/snmpconsole/snmp_view"]["subsecs"] = array(
"enterprise/godmode/snmpconsole",
"godmode/snmpconsole/snmp_trap_editor",
"godmode/snmpconsole/snmp_alert",
"godmode/snmpconsole/snmp_filters",
"godmode/snmpconsole/snmp_trap_generator");
$sub2 = array();
$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/tree']['text'] = __('Tree view');
$sub["operation/tree"]["refr"] = 0;
$sub["operation/snmpconsole/snmp_view"]["sub2"] = $sub2;
$menu["estado"]["sub"] = $sub;
//End of view agents
$sub['operation/tree']['text'] = __('Tree view');
$sub["operation/tree"]["refr"] = 0;
$menu["estado"]["sub"] = $sub;
//End of view agents
}
//Start network view
$menu["network"]["text"] = __('Network View');
$menu["network"]["sec2"] = "operation/agentes/networkmap_list";
$menu["network"]["refr"] = 0;
$menu["network"]["id"] = "oper-networkconsole";
$sub = array();
$sub["operation/agentes/networkmap_list"]["text"] = __('Network map');
$sub["operation/agentes/networkmap_list"]["refr"] = 0;
enterprise_hook ('networkmap_console');
$menu["network"]["sub"] = $sub;
//End networkview
if ($config['metaconsole'] == 0) {
//Start network view
$menu["network"]["text"] = __('Network View');
$menu["network"]["sec2"] = "operation/agentes/networkmap_list";
$menu["network"]["refr"] = 0;
$menu["network"]["id"] = "oper-networkconsole";
$sub = array();
$sub["operation/agentes/networkmap_list"]["text"] = __('Network map');
$sub["operation/agentes/networkmap_list"]["refr"] = 0;
enterprise_hook ('networkmap_console');
$menu["network"]["sub"] = $sub;
//End networkview
}
// Reporting
$menu["reporting"]["text"] = __('Reporting');
@ -172,25 +176,28 @@ if (check_acl ($config['id_user'], 0, "AR")) {
}
}
$sub["godmode/reporting/map_builder"]["sub2"] = $sub2;
$sub["godmode/reporting/graphs"]["text"] = __('Custom graphs');
//Set godomode path
$sub["godmode/reporting/graphs"]["subsecs"] = array(
"operation/reporting/graph_viewer",
"godmode/reporting/graph_builder");
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"]["subsecs"] = array(
"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');
$sub["operation/agentes/exportdata"]["subsecs"] = array("operation/agentes/exportdata");
enterprise_hook ('dashboard_menu');
enterprise_hook ('reporting_godmenu');
enterprise_hook ('dashboard_menu');
enterprise_hook ('reporting_godmenu');
}
$menu["reporting"]["sub"] = $sub;
//End reporting
//INI GIS Maps
if ($config['activate_gis']) {
if ($config['activate_gis'] and ($config['metaconsole'] == 0)) {
$menu["gismaps"]["text"] = __('GIS Maps');
$menu["gismaps"]["sec2"] = "operation/gis_maps/index";
$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?)
if (check_acl ($config['id_user'], 0, "AR")) {
if (check_acl ($config['id_user'], 0, "AR") and ($config['metaconsole'] == 0)) {
// Events
$menu["eventos"]["text"] = __('View events');
$menu["eventos"]["refr"] = 0;
@ -332,7 +339,7 @@ $menu["workspace"]["sub"] = $sub;
//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']) {
$menu["netf"]["text"] = __('Netflow');
$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?)
if (check_acl ($config['id_user'], 0, "AR")) {
//SNMP Console
$menu["snmpconsole"]["text"] = __('SNMP console');
$menu["snmpconsole"]["refr"] = 0;
$menu["snmpconsole"]["sec2"] = "operation/snmpconsole/snmp_view";
$menu["snmpconsole"]["id"] = "oper-snmpc";
if ($config['metaconsole'] == 0) {
//SNMP Console
$menu["snmpconsole"]["text"] = __('SNMP console');
$menu["snmpconsole"]["refr"] = 0;
$menu["snmpconsole"]["sec2"] = "operation/snmpconsole/snmp_view";
$menu["snmpconsole"]["id"] = "oper-snmpc";
}
// Extensions menu additions
if (is_array ($config['extensions'])) {
@ -374,7 +383,8 @@ if (check_acl ($config['id_user'], 0, "AR")) {
}
else {
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']]["refr"] = 0;
$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);
?>