From fe858eb895866fe9bc5e6cb23bfc9206dc73902c Mon Sep 17 00:00:00 2001 From: Irina Gómez Date: Wed, 6 May 2020 11:26:24 +0200 Subject: #977 Fixed bug in ogAdmAgent: when starting a task in a organizational unit with groups of laboratories or in a labs with groups of computers, the service stop. --- admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.cpp b/admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.cpp index 2f0f442b..6bf23512 100644 --- a/admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.cpp +++ b/admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.cpp @@ -661,16 +661,16 @@ BOOLEAN RecopilaIpesMacs(Database db,int ambito,int idambito,char *restrambito) switch(ambito){ case AMBITO_CENTROS : - sprintf(sqlstr,"SELECT idcentro FROM centros WHERE idcentro=%d",idambito); - RecorreCentro(db,sqlstr); + sprintf(sqlstr,"SELECT ip,mac,idordenador FROM ordenadores INNER JOIN aulas WHERE ordenadores.idaula=aulas.idaula AND idcentro=%d ORDER BY ordenadores.idaula, ordenadores.ip;",idambito); + RecorreOrdenadores(db,sqlstr); break; case AMBITO_GRUPOSAULAS : sprintf(sqlstr,"SELECT idgrupo FROM grupos WHERE idgrupo=%d AND tipo=%d",idambito,AMBITO_GRUPOSAULAS); RecorreGruposAulas(db,sqlstr); break; case AMBITO_AULAS : - sprintf(sqlstr,"SELECT idaula FROM aulas WHERE idaula=%d",idambito); - RecorreAulas(db,sqlstr); + sprintf(sqlstr,"SELECT ip,mac,idordenador FROM ordenadores WHERE idaula=%d ORDER BY ip;",idambito); + RecorreOrdenadores(db,sqlstr); break; case AMBITO_GRUPOSORDENADORES : sprintf(sqlstr,"SELECT idgrupo FROM gruposordenadores WHERE idgrupo=%d",idambito); -- cgit v1.2.3-18-g5258