2012-07-09 Sergio Martin <sergio.martin@artica.es>

* operation/extensions.php
	operation/menu.php
	godmode/extensions.php
	godmode/menu.php: Show the hidded menus and 
	extensions when metaconsole is enabled



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6757 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-07-09 15:51:32 +00:00
parent ca389b1a06
commit 6094347990
5 changed files with 24 additions and 31 deletions

View File

@ -1,3 +1,11 @@
2012-07-09 Sergio Martin <sergio.martin@artica.es>
* operation/extensions.php
operation/menu.php
godmode/extensions.php
godmode/menu.php: Show the hidded menus and
extensions when metaconsole is enabled
2012-07-09 Vanessa Gil <vanessa.gil@artica.es>
* clock2.png: Add image.

View File

@ -257,14 +257,6 @@ foreach ($extensions as $file => $extension) {
$data[] = '<a title="' . __('Delete') . '" href="index.php?sec=gextensions&amp;sec2=godmode/extensions&enterprise=' . (int)$extension['enterprise'] . '&delete='.$file.'" class="mn">' . html_print_image("images/cross.png", true) . '</a>' .
' <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;
}

View File

@ -24,7 +24,7 @@ require_once ('include/functions_menu.php');
$menu_godmode = array ();
$menu_godmode['class'] = 'godmode';
if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "AW")) {
$menu_godmode["gagente"]["text"] = __('Manage monitoring');
$menu_godmode["gagente"]["sec2"] = "godmode/agentes/modificar_agente";
$menu_godmode["gagente"]["id"] = "god-agents";
@ -47,7 +47,7 @@ if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) {
$menu_godmode["gagente"]["sub"] = $sub;
}
if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "AW")) {
$menu_godmode["gmassive"]["text"] = __('Massive operations');
$menu_godmode["gmassive"]["sec2"] = "godmode/massive/massive_operations";
$menu_godmode["gmassive"]["id"] = "god-massive";
@ -70,7 +70,7 @@ if (check_acl ($config['id_user'], 0, "AW")) {
}
*/
if (check_acl ($config['id_user'], 0, "PM") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "PM")) {
$menu_godmode["gmodules"]["text"] = __('Manage modules');
$menu_godmode["gmodules"]["sec2"] = "godmode/modules/manage_network_templates";
$menu_godmode["gmodules"]["id"] = "god-modules";
@ -91,7 +91,7 @@ if (check_acl ($config['id_user'], 0, "PM") and ($config['metaconsole'] == 0)) {
$menu_godmode["gmodules"]["sub"] = $sub;
}
if (check_acl ($config['id_user'], 0, "LM") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "LM")) {
$menu_godmode["galertas"]["text"] = __('Manage alerts');
$menu_godmode["galertas"]["sec2"] = "godmode/alerts/alert_list";
$menu_godmode["galertas"]["id"] = "god-alerts";
@ -110,11 +110,11 @@ if (check_acl ($config['id_user'], 0, "LM") and ($config['metaconsole'] == 0)) {
$menu_godmode["galertas"]["sub"] = $sub;
}
if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "AW")) {
enterprise_hook ('policies_menu');
}
if (check_acl ($config['id_user'], 0, "UM") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "UM")) {
$menu_godmode["gusuarios"]["text"] = __('Manage users');
$menu_godmode["gusuarios"]["sec2"] = "godmode/users/user_list";
$menu_godmode["gusuarios"]["id"] = "god-users";
@ -126,7 +126,7 @@ if (check_acl ($config['id_user'], 0, "UM") and ($config['metaconsole'] == 0)) {
}
// GIS
if (check_acl ($config['id_user'], 0, "IW") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "IW")) {
if ($config['activate_gis']) {
$menu_godmode["godgismaps"]["text"] = __('GIS Maps builder');
@ -141,7 +141,7 @@ if (check_acl ($config['id_user'], 0, "IW") and ($config['metaconsole'] == 0)) {
}
}
if (check_acl ($config['id_user'], 0, "IW") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "IW")) {
// Manage events
$menu_godmode["geventos"]["text"] = __('Manage events');
$menu_godmode["geventos"]["sec2"] = "godmode/events/events&amp;section=filter";
@ -154,7 +154,7 @@ if (check_acl ($config['id_user'], 0, "IW") and ($config['metaconsole'] == 0)) {
$menu_godmode["geventos"]["sub"] = $sub;
}
if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "AW")) {
// Servers
$menu_godmode["gservers"]["text"] = __('Manage servers');
@ -176,7 +176,7 @@ if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) {
$menu_godmode["gservers"]["sub"] = $sub;
}
if (check_acl ($config['id_user'], 0, "LW") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "LW")) {
enterprise_hook ('snmpconsole_menu');
}
@ -212,7 +212,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
$menu_godmode["gsetup"]["sub"] = $sub;
}
if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "AW")) {
if ($config['activate_netflow']) {
//Netflow
$menu_godmode["netf"]["text"] = __('Netflow');
@ -227,7 +227,7 @@ if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) {
}
}
if (check_acl ($config['id_user'], 0, "DM") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "DM")) {
$menu_godmode["gdbman"]["text"] = __('DB maintenance');
$menu_godmode["gdbman"]["sec2"] = "godmode/db/db_main";
$menu_godmode["gdbman"]["id"] = "god-dbmaint";
@ -270,8 +270,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
} else {
if (array_key_exists('fatherId',$extmenu)) {
// Check that extension father ID exists previously on the menu (only if metaconsole is activated)
if (strlen($extmenu['fatherId']) > 0 and (($config['metaconsole'] == 0) or (array_key_exists($extension_menu['fatherId'], $menu_godmode)))) {
if (strlen($extmenu['fatherId']) > 0) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
if ($extmenu["name"] != 'DB interface'){
if (!empty($config['refr'])){

View File

@ -55,12 +55,6 @@ 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'];

View File

@ -197,7 +197,7 @@ if (check_acl ($config['id_user'], 0, "AR")) {
//INI GIS Maps
if ($config['activate_gis'] and ($config['metaconsole'] == 0)) {
if ($config['activate_gis']) {
$menu_operation["gismaps"]["text"] = __('GIS Maps');
$menu_operation["gismaps"]["sec2"] = "operation/gis_maps/index";
$menu_operation["gismaps"]["refr"] = 0;
@ -236,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") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "AR")) {
// Events
$menu_operation["eventos"]["text"] = __('View events');
$menu_operation["eventos"]["refr"] = 0;
@ -339,7 +339,7 @@ $menu_operation["workspace"]["sub"] = $sub;
//End Workspace
if (check_acl ($config['id_user'], 0, "IR") and ($config['metaconsole'] == 0)) {
if (check_acl ($config['id_user'], 0, "IR")) {
if ($config['activate_netflow']) {
$menu_operation["netf"]["text"] = __('Netflow');
$menu_operation["netf"]["sec2"] = "operation/netflow/nf_reporting";