summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/rest
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2017-10-26 11:25:54 +0000
committerramon <ramongomez@us.es>2017-10-26 11:25:54 +0000
commit8182ab1483c8edea495e8877b8ae64fdb5323a76 (patch)
treeb029502038bc14f7543da4870c926eab52b2cceb /admin/WebConsole/rest
parent4519fd24b5129f69a8a0b7413d839d83a1c661a0 (diff)
#708: Adaptar SQL a la estructura de la tabla de operaciones de OGAgent.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5484 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/rest')
-rw-r--r--admin/WebConsole/rest/remotepc.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/admin/WebConsole/rest/remotepc.php b/admin/WebConsole/rest/remotepc.php
index 3a986929..61670fbd 100644
--- a/admin/WebConsole/rest/remotepc.php
+++ b/admin/WebConsole/rest/remotepc.php
@@ -401,11 +401,11 @@ EOD;
writeRemotepcLog($app->request()->getResourceUri(). ": Updating database.");
$cmd->texto = <<<EOD
DELETE FROM ogagent_queue
- WHERE id='$clntid' AND command IN ('popup-10', 'popup-5', 'poweroff');
+ WHERE clientid = '$clntid' AND command IN ('popup-10', 'popup-5', 'poweroff');
EOD;
$cmd->Ejecutar();
# Add new commands to OGAgent operations queue.
- $cmd->texto = "INSERT INTO ogagent_queue (id, time, command) VALUES";
+ $cmd->texto = "INSERT INTO ogagent_queue (clientid, exectime, command) VALUES";
if ($deadLine > 600) {
# Add reminder 10 min. before deadline.
$cmd->texto .= " ($clntid, NOW() + INTERVAL $deadLine SECOND - INTERVAL 10 MINUTE, 'popup-10'),";
@@ -496,7 +496,7 @@ EOD;
$clntip = $rs->campos["ip"];
$agentkey = $rs->campos["agentkey"];
// DB Transaction: set reservation time to the past and
- // remove pending boot commands from client's actions queue.
+ // remove pending boot commands from client's and agent's queues.
$cmd->texto = "START TRANSACTION;";
$cmd->Ejecutar();
$cmd->texto = <<<EOD
@@ -511,6 +511,10 @@ DELETE FROM acciones
AND descriaccion = 'RemotePC Session';
EOD;
$cmd->Ejecutar();
+ $cmd->texto = <<<EOD
+DELETE FROM ogagent_queue
+ WHERE clientid = '$clntid' AND command IN ('popup-10', 'popup-5', 'poweroff');
+ $cmd->Ejecutar();
$cmd->texto = "COMMIT;";
$cmd->Ejecutar();
// Send a poweroff command to client's OGAgent.