2010-10-06 Dario Rodriguez <dario.rodriguez@artica.es>

*operation/agentes/estado_agente.php, ver_agente.php: Fixed some problems 
	processing the input



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3349 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2010-10-06 11:04:16 +00:00
parent 17d78a4427
commit ddc1cf44f0
3 changed files with 23 additions and 13 deletions

View File

@ -1,3 +1,8 @@
2010-10-06 Dario Rodriguez <dario.rodriguez@artica.es>
*operation/agentes/estado_agente.php, ver_agente.php: Fixed some problems
processing the input
2010-10-06 Miguel de Dios <miguel.dedios@artica.es> 2010-10-06 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor.php: cleaned source code style. * godmode/agentes/module_manager_editor.php: cleaned source code style.

View File

@ -32,13 +32,15 @@ if (is_ajax ()) {
if ($get_actions_alert_template) { if ($get_actions_alert_template) {
$id_template = get_parameter("id_template"); $id_template = get_parameter("id_template");
$rows = get_db_all_rows_sql("SELECT t1.id, t1.name, $sql = sprintf ("SELECT t1.id, t1.name,
(SELECT COUNT(t2.id) (SELECT COUNT(t2.id)
FROM talert_templates AS t2 FROM talert_templates AS t2
WHERE t2.id = " . $id_template . " WHERE t2.id = %d
AND t2.id_alert_action = t1.id) as 'sort_order' AND t2.id_alert_action = t1.id) as 'sort_order'
FROM talert_actions AS t1 FROM talert_actions AS t1
ORDER BY sort_order DESC"); ORDER BY sort_order DESC", $id_template);
$rows = get_db_all_rows_sql($sql);
if ($rows !== false) if ($rows !== false)
@ -66,7 +68,7 @@ if (is_ajax ()) {
} }
// Take some parameters (GET) // Take some parameters (GET)
$group_id = get_parameter ("group_id", 0); $group_id = (int) get_parameter ("group_id", 0);
$search = get_parameter ("search", ""); $search = get_parameter ("search", "");
$offset = get_parameter('offset', 0); $offset = get_parameter('offset', 0);
$refr = get_parameter('refr', 0); $refr = get_parameter('refr', 0);

View File

@ -38,10 +38,10 @@ if (is_ajax ()) {
$get_group_status_tooltip = (bool) get_parameter ("get_group_status_tooltip"); $get_group_status_tooltip = (bool) get_parameter ("get_group_status_tooltip");
if ($get_agents_group_json) { if ($get_agents_group_json) {
$id_group = get_parameter('id_group'); $id_group = (int) get_parameter('id_group');
if($id_group > 0) if($id_group > 0)
$filter = " WHERE id_grupo = ". $id_group; $filter = sprintf(" WHERE id_grupo = %d", $id_group);
else { else {
$groups_orig = get_user_groups(); $groups_orig = get_user_groups();
@ -283,16 +283,19 @@ if (! give_acl ($config['id_user'], $id_grupo, "AR")) {
} }
// Check for Network FLAG change request // Check for Network FLAG change request
if (isset($_GET["flag"])) { $flag = get_parameter('flag', '');
if ($_GET["flag"] == 1 && give_acl ($config['id_user'], $id_grupo, "AW")) { if ($flag !== '') {
$sql = "UPDATE tagente_modulo SET flag=1 WHERE id_agente_modulo = ".$_GET["id_agente_modulo"]; if ($flag == 1 && give_acl ($config['id_user'], $id_grupo, "AW")) {
$id_agent_module = get_parameter('id_agente_modulo');
$sql = sprintf("UPDATE tagente_modulo SET flag=1 WHERE id_agente_modulo = %d", $id_agent_module);
process_sql ($sql); process_sql ($sql);
} }
} }
// Check for Network FLAG change request // Check for Network FLAG change request
if (isset($_GET["flag_agent"])){ $flag_agent = get_parameter('flag_agent','');
if ($_GET["flag_agent"] == 1 && give_acl ($config['id_user'], $id_grupo, "AW")) { if ($flag_agent !== ''){
$sql ="UPDATE tagente_modulo SET flag=1 WHERE id_agente = ". $id_agente; if ($flag_agent == 1 && give_acl ($config['id_user'], $id_grupo, "AW")) {
$sql = sprintf("UPDATE tagente_modulo SET flag=1 WHERE id_agente = %d", $id_agente);
process_sql ($sql); process_sql ($sql);
} }
} }