summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2020-05-06 11:26:24 +0200
committerIrina Gómez <irinagomez@us.es>2020-05-06 11:26:24 +0200
commitfe858eb895866fe9bc5e6cb23bfc9206dc73902c (patch)
treefdcbd56a0d5d0166f27d6b7174a8d31125a3899e
parent9fe0fe30b7b844c04f72b7506a503df257902c11 (diff)
#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.
-rw-r--r--admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.cpp8
1 files 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);