, 2003-2006 // Raul Mateos , 2005-2006 // Load global vars require("include/config.php"); if (give_acl($id_user, 0, "AW")==1) { if (isset($_GET["borrar_agente"])){ // if delete agent $id_agente = entrada_limpia($_GET["borrar_agente"]); $id_grupo = dame_id_grupo($id_agente); if (give_acl($id_user, $id_grupo, "AW")==1){ // Firts delete from agents table $sql_delete= "DELETE FROM tagente WHERE id_agente = ".$id_agente; $result=mysql_query($sql_delete); if (! $result) echo "

".$lang_label["delete_agent_no"]."

"; else echo "

".$lang_label["delete_agent_ok"]."

"; // Delete agent access table $sql_delete = "DELETE FROM tagent_access WHERE id_agent = ".$id_agente; // Delete tagente_datos data $result=mysql_query($sql_delete); $sql_delete4="DELETE FROM tagente_datos WHERE id_agente=".$id_agente; $result=mysql_query($sql_delete4); // Delete tagente_datos_string data $result=mysql_query($sql_delete); $sql_delete4="DELETE FROM tagente_datos_string WHERE id_agente=".$id_agente; $result=mysql_query($sql_delete4); // Delete from tagente_datos $sql1='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente; $result1=mysql_query($sql1); while ($row=mysql_fetch_array($result1)){ $sql_delete4="DELETE FROM tagente_datos_inc WHERE id_agente_modulo=".$row["id_agente_modulo"]; $result=mysql_query($sql_delete4); } $sql_delete2 ="DELETE FROM tagente_modulo WHERE id_agente = ".$id_agente; // delete from tagente_modulo $sql_delete3 ="DELETE FROM tagente_estado WHERE id_agente = ".$id_agente; // delete from tagente_estado $result=mysql_query($sql_delete2); $result=mysql_query($sql_delete3); } else { audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to delete an Agent"); require ("general/noaccess.php"); } } echo "

".$lang_label["agent_conf"]."

"; echo "

".$lang_label["agent_defined2"]."

"; // Load icon index from tgrupos $iconindex_g[]=""; $sql_g='SELECT * FROM tgrupo'; $result_g=mysql_query($sql_g); while ($row_g=mysql_fetch_array($result_g)){ $iconindex_g[$row_g["id_grupo"]] = $row_g["icon"]; } $sql1='SELECT * FROM tagente ORDER BY nombre'; $result=mysql_query($sql1); if (mysql_num_rows($result)){ echo ""; echo "'; echo ''; echo ''; } } echo ""; echo "
".$lang_label["agent_name"]; echo "".$lang_label["group"]; echo "".$lang_label["description"]; echo "".$lang_label["delete"]; while ($row=mysql_fetch_array($result)){ $id_grupo = $row["id_grupo"]; if (give_acl($id_user, $id_grupo, "AW")==1){ echo "
".$row["nombre"].""; echo ' ( '.dame_grupo($id_grupo).' )'.$row["comentarios"].'
"; echo "
"; echo ""; echo "
"; echo ""; } else { echo ''.$lang_label["no_agent_def"].'

'; echo "
"; echo ""; echo "
"; } } // Fin pagina else { audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent Management"); require ("general/noaccess.php"); } ?>