diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2018-06-14 10:48:39 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2018-06-14 10:59:34 +0200 |
commit | b60d6b807c580e58f06a337def9a1a83b1f3bcfc (patch) | |
tree | 7ee39403eb4f70a9f7120eb8168d6317b339bf1e /admin/WebConsole/rest/remotepc.php | |
parent | 5367fb5e61f2e89797bfe7df0e4811a1ff890f08 (diff) | |
parent | e0e4c021382f2c8a66402c545229aa8e528750f9 (diff) |
#794: Applying new commits from {{{devel}}} branch to {{{pjlink}}} branch.
Diffstat (limited to 'admin/WebConsole/rest/remotepc.php')
-rw-r--r-- | admin/WebConsole/rest/remotepc.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/admin/WebConsole/rest/remotepc.php b/admin/WebConsole/rest/remotepc.php index 39224636..4bf7b6b5 100644 --- a/admin/WebConsole/rest/remotepc.php +++ b/admin/WebConsole/rest/remotepc.php @@ -81,7 +81,7 @@ $app->post('/ous/:ouid/images/:imageid/reserve(/)', 'validateApiKey', writeRemotepcLog($app->request()->getResourceUri(). ": Parameters: labid=$labid, maxtime=$maxtime"); // Choose older not-reserved client with image installed and get ogAdmServer data. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, entornos.ipserveradm, entornos.portserveradm, +SELECT adm.idusuario, entornos.ipserveradm, entornos.portserveradm, ordenadores.idordenador, ordenadores.nombreordenador, ordenadores.ip, ordenadores.mac, ordenadores.agentkey, ordenadores_particiones.numdisk, ordenadores_particiones.numpar, aulas.idaula, aulas.idcentro @@ -92,7 +92,7 @@ SELECT adm.idadministradorcentro, entornos.ipserveradm, entornos.portserveradm, RIGHT JOIN ordenadores_particiones USING(idordenador) RIGHT JOIN imagenes USING(idimagen) LEFT JOIN remotepc ON remotepc.id=ordenadores.idordenador - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND aulas.idcentro = '$ouid' AND aulas.idaula LIKE '$labid' AND aulas.inremotepc = 1 AND imagenes.idimagen = '$imageid' AND imagenes.inremotepc = 1 AND (remotepc.reserved < NOW() OR ISNULL(reserved)) @@ -103,7 +103,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is admin and client exists. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Read query data. $serverip = $rs->campos["ipserveradm"]; $serverport = $rs->campos["portserveradm"]; @@ -290,13 +290,13 @@ $app->post('/ous/:ouid/labs/:labid/clients/:clntid/events', 'validateApiKey', writeRemotepcLog($app->request()->getResourceUri(). ": Parameters: urlLogin=$urlLogin, urlLogout=$urlLogout"); // Select client data for UDS compatibility. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador, remotepc.* +SELECT adm.idusuario, ordenadores.idordenador, remotepc.* FROM remotepc RIGHT JOIN ordenadores ON remotepc.id=ordenadores.idordenador JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) RIGHT JOIN usuarios USING(idusuario) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro = '$ouid' AND aulas.idaula ='$labid' AND ordenadores.idordenador = '$clntid'; EOD; @@ -305,7 +305,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is admin and client exists. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Check if client is reserved. if (! is_null($rs->campos["reserved"])) { // Updating DB if client is reserved. @@ -381,12 +381,12 @@ $app->post('/ous/:ouid/labs/:labid/clients/:clntid/session', 'validateApiKey', writeRemotepcLog($app->request()->getResourceUri(). ": Parameters: deadLine=$deadLine"); // Get client's data. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador, remotepc.* +SELECT adm.idusuario, ordenadores.idordenador, remotepc.* FROM remotepc RIGHT JOIN ordenadores ON remotepc.id=ordenadores.idordenador JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND aulas.idcentro = '$ouid' AND aulas.idaula = '$labid' AND ordenadores.idordenador = '$clntid'; EOD; @@ -395,7 +395,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is admin and client exists. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Check if client is reserved. if (! is_null($rs->campos["urllogin"])) { // Read query data. @@ -479,13 +479,13 @@ $app->delete('/ous/:ouid/labs/:labid/clients/:clntid/unreserve', 'validateApiKey // Select client data for UDS compatibility. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador, ordenadores.ip, ordenadores.agentkey, remotepc.reserved +SELECT adm.idusuario, ordenadores.idordenador, ordenadores.ip, ordenadores.agentkey, remotepc.reserved FROM remotepc RIGHT JOIN ordenadores ON remotepc.id=ordenadores.idordenador JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) RIGHT JOIN usuarios USING(idusuario) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro = '$ouid' AND aulas.idaula ='$labid' AND ordenadores.idordenador = '$clntid'; EOD; @@ -494,7 +494,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is admin and client exists. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Check if client is reserved. if (! is_null($rs->campos["reserved"])) { // Read query data. |