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:
mdtrooper 2012-04-18 12:56:14 +00:00
parent f95fb56b8d
commit d7f5a9d320
5 changed files with 26 additions and 8 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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>";