2012-04-18 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_agents.php: into the function "agents_get_agent_id" the parameter "$io_safe_input" for transform the names if true, by default false. * operation/agentes/networkmap.topology.php, operation/agentes/networkmap.php, include/functions_ui.php: cleaned source code style. Merged from th branch "pandora_4.0". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6017 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
014c8a37ef
commit
e2d77a9803
|
@ -1,3 +1,15 @@
|
|||
2012-04-18 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_agents.php: into the function
|
||||
"agents_get_agent_id" the parameter "$io_safe_input" for transform
|
||||
the names if true, by default false.
|
||||
|
||||
* operation/agentes/networkmap.topology.php,
|
||||
operation/agentes/networkmap.php, include/functions_ui.php: cleaned
|
||||
source code style.
|
||||
|
||||
Merged from th branch "pandora_4.0".
|
||||
|
||||
2012-04-18 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||
|
||||
* godmode/agentes/agent_manager.php: Fixed a problem with links
|
||||
|
|
|
@ -1068,10 +1068,10 @@ function agents_get_modules ($id_agent = null, $details = false, $filter = false
|
|||
}
|
||||
|
||||
$id_groups = array_keys($groups);
|
||||
|
||||
|
||||
$sql = "SELECT id_agente FROM tagente WHERE id_grupo IN (" . implode(',', $id_groups) . ")";
|
||||
$id_agent = db_get_all_rows_sql($sql);
|
||||
|
||||
|
||||
if($id_agent == false) {
|
||||
$id_agent = array();
|
||||
}
|
||||
|
@ -1302,10 +1302,14 @@ function agents_get_module_id ($id_agente_modulo) {
|
|||
* Get agent id from an agent name.
|
||||
*
|
||||
* @param string $agent_name Agent name to get its id.
|
||||
* @param boolean $io_safe_input If it is true transform to safe string, by default false.
|
||||
*
|
||||
* @return int Id from the agent of the given name.
|
||||
*/
|
||||
function agents_get_agent_id ($agent_name) {
|
||||
function agents_get_agent_id ($agent_name, $io_safe_input = false) {
|
||||
if ($io_safe_input) {
|
||||
$agent_name = io_safe_input($agent_name);
|
||||
}
|
||||
return (int) db_get_value ('id_agente', 'tagente', 'nombre', $agent_name);
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ function ui_print_truncate_text($text, $numChars = 25, $showTextInAToopTip = tru
|
|||
else{
|
||||
if ($style !== false){
|
||||
$truncateText = '<span style="' . $style . '">'.$truncateText.'</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -87,7 +87,7 @@ function ui_print_truncate_text($text, $numChars = 25, $showTextInAToopTip = tru
|
|||
$truncateText = '<span style="' . $style . '">' . $text . '</span>';
|
||||
}
|
||||
else{
|
||||
$truncateText = $text;
|
||||
$truncateText = $text;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ if($config['enterprise_installed']) {
|
|||
'text' => '<a href="index.php?sec=network&sec2=operation/agentes/networkmap&tab=policies&pure='.$pure.'">' .
|
||||
html_print_image("images/policies.png", true, array ("title" => __('Policies view'))) .'</a>');
|
||||
}
|
||||
|
||||
|
||||
$buttons['groups'] = array('active' => $activeTab == 'groups',
|
||||
'text' => '<a href="index.php?sec=network&sec2=operation/agentes/networkmap&tab=groups&pure='.$pure.'">' .
|
||||
html_print_image("images/group.png", true, array ("title" => __('Groups view'))) .'</a>');
|
||||
|
|
|
@ -61,7 +61,8 @@ $filename_dot .= "_".$id_networkmap.".dot";
|
|||
|
||||
if ($regen != 1 && file_exists ($filename_img) && filemtime ($filename_img) > get_system_time () - 300) {
|
||||
$result = true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$fh = @fopen ($filename_dot, 'w');
|
||||
if ($fh === false) {
|
||||
$result = false;
|
||||
|
@ -85,7 +86,8 @@ if ($result !== false) {
|
|||
}
|
||||
html_print_image ($filename_img, false, array ("alt" => __('Network map'), "usemap" => "#networkmap"));
|
||||
require ($filename_map);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui_print_error_message (__('Map could not be generated'));
|
||||
echo $result;
|
||||
echo "<div class='warn'>Apparently something went wrong executing the command or writing the output.</div>";
|
||||
|
|
Loading…
Reference in New Issue