Fixed the link of edit module in Metaconsole

This commit is contained in:
mdtrooper 2014-09-25 16:55:48 +02:00
parent 299b6f6a31
commit 07f62cc3e6

View File

@ -844,7 +844,7 @@ else {
$result = array(); $result = array();
$count_modules = 0; $count_modules = 0;
foreach($servers as $server) { foreach ($servers as $server) {
// If connection was good then retrieve all data server // If connection was good then retrieve all data server
if (metaconsole_connect($server) == NOERR) { if (metaconsole_connect($server) == NOERR) {
$connection = true; $connection = true;
@ -1068,18 +1068,39 @@ foreach ($result as $row) {
} }
$data[2] = html_print_image("images/" . modules_show_icon_type ($row["module_type"]), true); $data[2] = html_print_image("images/" . modules_show_icon_type ($row["module_type"]), true);
if (check_acl ($config['id_user'], $row['id_group'], "AW")) if (check_acl ($config['id_user'], $row['id_group'], "AW")) {
$data[2] .= '<a href="' . $show_edit_icon = true;
'index.php?' . if (defined('METACONSOLE')) {
if (!can_user_access_node ()) {
$show_edit_icon = false;
}
$url_edit_module = $row["server_url"] . 'index.php?' .
'sec=gagente&amp;' . 'sec=gagente&amp;' .
'sec2=godmode/agentes/configurar_agente&amp;' . 'sec2=godmode/agentes/configurar_agente&amp;' .
'id_agente=' . $row['id_agent'] . '&amp;' . 'id_agente=' . $row['id_agent'] . '&amp;' .
'tab=module&amp;' . 'tab=module&amp;' .
'id_agent_module=' . $row["id_agente_modulo"] . '&amp;' . 'id_agent_module=' . $row["id_agente_modulo"] . '&amp;' .
'edit_module=1">' . 'edit_module=1' .
'&amp;loginhash=auto&amp;loginhash_data=' . $row["hashdata"] . '&amp;loginhash_user=' . $row["user"];
}
else {
$url_edit_module = 'index.php?' .
'sec=gagente&amp;' .
'sec2=godmode/agentes/configurar_agente&amp;' .
'id_agente=' . $row['id_agent'] . '&amp;' .
'tab=module&amp;' .
'id_agent_module=' . $row["id_agente_modulo"] . '&amp;' .
'edit_module=1';
}
if ($show_edit_icon) {
$data[2] .= '<a href="' . $url_edit_module . '">' .
html_print_image("images/config.png", true, html_print_image("images/config.png", true,
array("alt" => '0', "border" => "", "title" => __('Edit'))) . array("alt" => '0', "border" => "", "title" => __('Edit'))) .
'</a>'; '</a>';
}
}
$data[3] = ui_print_truncate_text($row["module_name"], 'agent_small', false, true, true); $data[3] = ui_print_truncate_text($row["module_name"], 'agent_small', false, true, true);
if ($row["extended_info"] != "") { if ($row["extended_info"] != "") {
@ -1322,14 +1343,14 @@ ui_require_javascript_file('pandora_modules');
} }
function refresh_pagination_callback (module_id, id_agent, server_name) { function refresh_pagination_callback (module_id, id_agent, server_name) {
$(".binary_dialog").click( function() { $(".binary_dialog").click( function() {
var classes = $(this).attr('class'); var classes = $(this).attr('class');
classes = classes.split(' '); classes = classes.split(' ');
var offset_class = classes[2]; var offset_class = classes[2];
offset_class = offset_class.split('_'); offset_class = offset_class.split('_');
var offset = offset_class[1]; var offset = offset_class[1];
var period = $('#period').val(); var period = $('#period').val();
show_module_detail_dialog(module_id, id_agent, server_name, offset, period); show_module_detail_dialog(module_id, id_agent, server_name, offset, period);