diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2018-05-23 16:15:13 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2018-05-23 16:15:13 +0200 |
commit | 9bcea48e05b32decff286e8d1ebe2a15e8c48b98 (patch) | |
tree | 9cc7823713ff1bdc8bf2a28aed592ab758fddf31 | |
parent | 73a63e7953355891d31aba8e2820b3c8d057b42d (diff) |
#708: Aplicar cambios de revisión [c870c84] en rama {{{master}}}.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | admin/WebConsole/rest/remotepc.php | 24 | ||||
-rw-r--r-- | admin/WebConsole/rest/server.php | 82 |
3 files changed, 54 insertions, 53 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..485dee64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea 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. diff --git a/admin/WebConsole/rest/server.php b/admin/WebConsole/rest/server.php index 76a2f908..3ce1b57b 100644 --- a/admin/WebConsole/rest/server.php +++ b/admin/WebConsole/rest/server.php @@ -86,12 +86,12 @@ function getStatus($ouid, $labid, $clntid=0) { // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, entornos.ipserveradm, entornos.portserveradm, +SELECT adm.idusuario, entornos.ipserveradm, entornos.portserveradm, aulas.idaula, ordenadores.idordenador, ordenadores.ip FROM entornos, ordenadores JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND aulas.idaula='$labid' EOD; @@ -109,7 +109,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and asset exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and (($single and checkParameter($rs->campos["idordenador"])) or (! $single and checkParameter($rs->campos["idaula"])))) { + if (checkAdmin($rs->campos["idusuario"]) and (($single and checkParameter($rs->campos["idordenador"])) or (! $single and checkParameter($rs->campos["idaula"])))) { // First, try to connect to ogAdmCleint service. $serverip = $rs->campos["ipserveradm"]; $serverport = $rs->campos["portserveradm"]; @@ -320,7 +320,7 @@ $app->get('/ous/:ouid(/)', 'validateApiKey', SELECT * FROM centros RIGHT JOIN administradores_centros USING(idcentro) - WHERE administradores_centros.idadministradorcentro = '$userid' + WHERE administradores_centros.idusuario = '$userid' AND centros.idcentro = '$ouid' LIMIT 1; EOD; @@ -328,7 +328,7 @@ EOD; $rs->Comando=&$cmd; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idcentro"])) { $response['id'] = (int)$ouid; $response['name'] = $rs->campos["nombrecentro"]; @@ -352,10 +352,10 @@ $app->get('/ous/:ouid/groups(/)', 'validateApiKey', function($ouid) { $ouid = htmlspecialchars($ouid); // List group of labs if user is OU's admin. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, grupos.* +SELECT adm.idusuario, grupos.* FROM grupos RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro='$ouid'; EOD; $rs=new Recordset; @@ -363,7 +363,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin. - if (checkAdmin($rs->campos["idadministradorcentro"])) { + if (checkAdmin($rs->campos["idusuario"])) { $response = Array(); // Read data. if (! is_null($rs->campos["idcentro"])) { @@ -400,12 +400,12 @@ $app->get('/ous/:ouid/labs(/)', 'validateApiKey', $ouid = htmlspecialchars($ouid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, aulas.*, grp.idgrupo AS group_id, +SELECT adm.idusuario, aulas.*, grp.idgrupo AS group_id, grp.nombregrupoordenador, grp.grupoid AS group_group_id, grp.comentarios FROM aulas RIGHT JOIN administradores_centros AS adm USING(idcentro) LEFT JOIN gruposordenadores AS grp USING(idaula) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' ORDER BY aulas.idaula, grp.idgrupo EOD; @@ -414,7 +414,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is an UO admin. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"])) { + if (checkAdmin($rs->campos["idusuario"])) { $response = Array(); if (! is_null($rs->campos["idcentro"])) { while (!$rs->EOF) { @@ -477,11 +477,11 @@ $app->get('/ous/:ouid/labs/:labid(/)', 'validateApiKey', $labid = htmlspecialchars($labid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, COUNT(idordenador) AS defclients, aulas.* +SELECT adm.idusuario, COUNT(idordenador) AS defclients, aulas.* FROM aulas RIGHT JOIN administradores_centros AS adm USING(idcentro) LEFT JOIN ordenadores USING(idaula) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro='$ouid' AND idaula='$labid'; EOD; @@ -490,7 +490,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and lab exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idaula"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idaula"])) { $response['id'] = (int)$rs->campos["idaula"]; $response['name'] = $rs->campos["nombreaula"]; $response['location'] = $rs->campos["ubicacion"]; @@ -539,11 +539,11 @@ $app->get('/ous/:ouid/labs/:labid/clients(/)', 'validateApiKey', $labid = htmlspecialchars($labid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.*, aulas.idaula AS labid +SELECT adm.idusuario, ordenadores.*, aulas.idaula AS labid FROM ordenadores RIGHT JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND aulas.idaula='$labid'; EOD; @@ -552,7 +552,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and lab exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["labid"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["labid"])) { $response = Array(); while (!$rs->EOF) { if (!is_null($rs->campos["idordenador"])) { @@ -600,11 +600,11 @@ $app->get('/ous/:ouid/labs/:labid/clients/:clntid(/)', 'validateApiKey', $clntid = htmlspecialchars($clntid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.* +SELECT adm.idusuario, ordenadores.* FROM ordenadores JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro='$ouid' AND idaula='$labid' AND idordenador='$clntid'; @@ -614,7 +614,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin, lab exists and client exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idaula"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idaula"]) and checkParameter($rs->campos["idordenador"])) { // Read data. $response['id'] = (int)$rs->campos["idordenador"]; $response['name'] = $rs->campos["nombreordenador"]; @@ -655,7 +655,7 @@ $app->get('/ous/:ouid/labs/:labid/clients/:clntid/hardware(/)', 'validateApiKey' $clntid = htmlspecialchars($clntid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador, ordenadores.nombreordenador, +SELECT adm.idusuario, ordenadores.idordenador, ordenadores.nombreordenador, tipohardwares.nemonico, hardwares.descripcion FROM ordenadores JOIN aulas USING(idaula) @@ -663,7 +663,7 @@ SELECT adm.idadministradorcentro, ordenadores.idordenador, ordenadores.nombreord LEFT JOIN perfileshard_hardwares USING(idperfilhard) LEFT JOIN hardwares ON perfileshard_hardwares.idhardware=hardwares.idhardware LEFT JOIN tipohardwares ON tipohardwares.idtipohardware=hardwares.idtipohardware - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND aulas.idaula='$labid' AND ordenadores.idordenador='$clntid'; @@ -673,7 +673,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and client exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Read data. $response['id'] = (int)$rs->campos["idordenador"]; $response['name'] = $rs->campos["nombreordenador"]; @@ -711,7 +711,7 @@ $app->get('/ous/:ouid/labs/:labid/clients/:clntid/diskcfg(/)', 'validateApiKey', $clntid = htmlspecialchars($clntid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador AS clientid, +SELECT adm.idusuario, ordenadores.idordenador AS clientid, ordenadores.nombreordenador, ordenadores_particiones.*, tipospar.tipopar, sistemasficheros.nemonico, nombresos.nombreso, imagenes.nombreca, (imagenes.revision - ordenadores_particiones.revision) AS difimagen @@ -723,7 +723,7 @@ SELECT adm.idadministradorcentro, ordenadores.idordenador AS clientid, LEFT JOIN sistemasficheros USING(idsistemafichero) LEFT JOIN nombresos USING(idnombreso) LEFT JOIN imagenes USING(idimagen) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND aulas.idaula='$labid' AND ordenadores.idordenador='$clntid' @@ -734,7 +734,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and client exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["clientid"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["clientid"])) { // Read data. $response['id'] = (int)$rs->campos["clientid"]; $response['name'] = $rs->campos["nombreordenador"]; @@ -809,10 +809,10 @@ $app->get('/ous/:ouid/repos(/)', 'validateApiKey', $ouid = htmlspecialchars($ouid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, adm.idcentro AS ouid, repositorios.* +SELECT adm.idusuario, adm.idcentro AS ouid, repositorios.* FROM repositorios RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid'; EOD; $rs=new Recordset; @@ -820,7 +820,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["ouid"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["ouid"])) { $response = Array(); while (!$rs->EOF) { if (! is_null($rs->campos["idcentro"])) { @@ -854,10 +854,10 @@ $app->get('/ous/:ouid/repos/:repoid(/)', 'validateApiKey', $repoid = htmlspecialchars($repoid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, repositorios.* +SELECT adm.idusuario, repositorios.* FROM repositorios RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND idrepositorio='$repoid'; EOD; @@ -866,7 +866,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and repo exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idrepositorio"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idrepositorio"])) { // Read data. $response['id'] = (int)$rs->campos["idrepositorio"]; $response['name'] = $rs->campos["nombrerepositorio"]; @@ -893,10 +893,10 @@ $app->get('/ous/:ouid/images(/)', 'validateApiKey', $ouid = htmlspecialchars($ouid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, adm.idcentro AS ouid, imagenes.* +SELECT adm.idusuario, adm.idcentro AS ouid, imagenes.* FROM imagenes RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid'; EOD; $rs=new Recordset; @@ -904,7 +904,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["ouid"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["ouid"])) { $response = Array(); while (!$rs->EOF) { if (! is_null($rs->campos["idcentro"])) { @@ -938,12 +938,12 @@ $app->get('/ous/:ouid/images/:imgid(/)', 'validateApiKey', $imgid = htmlspecialchars($imgid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, imagenes.*, nombreso AS os +SELECT adm.idusuario, imagenes.*, nombreso AS os FROM imagenes RIGHT JOIN administradores_centros AS adm USING(idcentro) LEFT JOIN perfilessoft USING(idperfilsoft) LEFT JOIN nombresos USING(idnombreso) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND idimagen='$imgid'; EOD; @@ -952,7 +952,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and repo exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idimagen"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idimagen"])) { // Read data. $response['id'] = (int)$rs->campos["idimagen"]; $response['name'] = $rs->campos["nombreca"]; @@ -995,7 +995,7 @@ $app->get('/ous/:ouid/images/:imgid/software(/)', 'validateApiKey', $imgid = htmlspecialchars($imgid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, imagenes.idimagen, imagenes.nombreca, +SELECT adm.idusuario, imagenes.idimagen, imagenes.nombreca, nombresos.nombreso, softwares.descripcion FROM imagenes RIGHT JOIN administradores_centros AS adm USING(idcentro) @@ -1003,7 +1003,7 @@ SELECT adm.idadministradorcentro, imagenes.idimagen, imagenes.nombreca, LEFT JOIN nombresos USING(idnombreso) LEFT JOIN perfilessoft_softwares USING(idperfilsoft) LEFT JOIN softwares USING(idsoftware) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND imagenes.idimagen='$imgid' ORDER BY softwares.descripcion ASC; EOD; @@ -1012,7 +1012,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and repo exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idimagen"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idimagen"])) { $response['id'] = (int)$rs->campos["idimagen"]; $response['name'] = $rs->campos["nombreca"]; if (is_null($rs->campos["nombreso"])) { |