mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-25 23:05:30 +02:00
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
f95fb56b8d
commit
d7f5a9d320
@ -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>
|
2012-04-18 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||||
|
|
||||||
* godmode/agentes/agent_manager.php: Fixed a problem with links
|
* godmode/agentes/agent_manager.php: Fixed a problem with links
|
||||||
|
@ -1302,10 +1302,14 @@ function agents_get_module_id ($id_agente_modulo) {
|
|||||||
* Get agent id from an agent name.
|
* Get agent id from an agent name.
|
||||||
*
|
*
|
||||||
* @param string $agent_name Agent name to get its id.
|
* @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.
|
* @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);
|
return (int) db_get_value ('id_agente', 'tagente', 'nombre', $agent_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,8 @@ $filename_dot .= "_".$id_networkmap.".dot";
|
|||||||
|
|
||||||
if ($regen != 1 && file_exists ($filename_img) && filemtime ($filename_img) > get_system_time () - 300) {
|
if ($regen != 1 && file_exists ($filename_img) && filemtime ($filename_img) > get_system_time () - 300) {
|
||||||
$result = true;
|
$result = true;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$fh = @fopen ($filename_dot, 'w');
|
$fh = @fopen ($filename_dot, 'w');
|
||||||
if ($fh === false) {
|
if ($fh === false) {
|
||||||
$result = false;
|
$result = false;
|
||||||
@ -85,7 +86,8 @@ if ($result !== false) {
|
|||||||
}
|
}
|
||||||
html_print_image ($filename_img, false, array ("alt" => __('Network map'), "usemap" => "#networkmap"));
|
html_print_image ($filename_img, false, array ("alt" => __('Network map'), "usemap" => "#networkmap"));
|
||||||
require ($filename_map);
|
require ($filename_map);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
ui_print_error_message (__('Map could not be generated'));
|
ui_print_error_message (__('Map could not be generated'));
|
||||||
echo $result;
|
echo $result;
|
||||||
echo "<div class='warn'>Apparently something went wrong executing the command or writing the output.</div>";
|
echo "<div class='warn'>Apparently something went wrong executing the command or writing the output.</div>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user