From ee4e38351e1f84dac191b6f844f44fd711a9702b Mon Sep 17 00:00:00 2001 From: esanchezm Date: Wed, 7 Jan 2009 10:49:42 +0000 Subject: [PATCH] 2009-01-07 Esteban Sanchez * godmode/agentes/modificar_agente.php: Old functions replace with new ones. Removed one indentation level when there's no access rights. * include/functions_ui.php: Wrong variable was being used in print_group_icon() to store the output and an incosistent behaviour was happening. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1320 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 9 ++ .../godmode/agentes/modificar_agente.php | 93 ++++++++++--------- pandora_console/include/functions_ui.php | 12 +-- 3 files changed, 63 insertions(+), 51 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ebbb088c29..144e518c54 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2009-01-07 Esteban Sanchez + + * godmode/agentes/modificar_agente.php: Old functions replace with new + ones. Removed one indentation level when there's no access rights. + + * include/functions_ui.php: Wrong variable was being used in + print_group_icon() to store the output and an incosistent behaviour + was happening. + 2009-01-07 Esteban Sanchez * include/functions_ui.php: Added to repository. Functions that prints diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index e1eec37af5..f16bca0cd4 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -234,46 +234,49 @@ if (mysql_num_rows($result)){ $tdcolor = "datos2"; $color = 1; } - if (give_acl($config["id_user"], $id_grupo, "AW")==1){ - // Agent name - echo ""; - if ($row["disabled"] == 1){ - echo ""; - } - echo "".substr(strtoupper($row["nombre"]),0,20).""; - if ($row["disabled"] == 1){ - echo ""; - } - echo ""; - - echo ""; - // Has remote configuration ? - $agent_md5 = md5($row["nombre"], FALSE); - if (file_exists($config["remote_config"] . "/" . $agent_md5 . ".md5")){ - - echo ""; - echo ""; - echo ""; - } - echo ""; - - - // Operating System icon - echo ""; - print_os_icon ($row["id_os"], false); - echo ""; - // Group icon and name - echo "".print_group_icon ($id_grupo, true).""; - // Description - echo "".$row["comentarios"].""; - // Action - echo "'; - echo ""; + if (! give_acl($config["id_user"], $id_grupo, "AW")) + continue; + + // Agent name + echo ""; + echo ""; + if ($row["disabled"] == 1){ + echo ""; } + echo "".substr(strtoupper($row["nombre"]),0,20).""; + if ($row["disabled"] == 1){ + echo ""; + } + echo ""; + + echo ""; + // Has remote configuration ? + $agent_md5 = md5 ($row["nombre"], false); + if (file_exists ($config["remote_config"]."/".$agent_md5.".md5")) { + + echo ""; + echo ""; + echo ""; + } + echo ""; + + // Operating System icon + echo ""; + print_os_icon ($row["id_os"], false); + echo ""; + // Group icon and name + echo ""; + print_group_icon ($id_grupo); + echo "  ".get_group_name ($id_grupo).""; + // Description + echo "".$row["comentarios"].""; + // Action + echo "'; + echo ""; } echo ""; echo "
"; @@ -282,10 +285,10 @@ if (mysql_num_rows($result)){ echo " 
"; } - // Create agent button - echo "
"; - echo ""; - echo "
"; +// Create agent button +echo "
"; +echo ""; +echo "
"; ?> diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 783312f859..8292e133f7 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -18,7 +18,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. /** - * Evaluates a result using empty () and then prints an error message or a + * Evaluates a result using empty() and then prints an error message or a * success message * * @param mixed $result the results to evaluate. 0, NULL, false, '' or array() @@ -155,14 +155,14 @@ function print_group_icon ($id_group, $return = false, $path = "groups_small") { return "-"; } - $return = ''; - $return .= ''.get_group_name ($id_group).''; - $return .= ''; + $output = ''; + $output .= ''.get_group_name ($id_group).''; + $output .= ''; if ($return) - return $return; + return $output; - echo $return; + echo $output; } /**