summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2020-04-01 12:54:37 +0200
committerRamón M. Gómez <ramongomez@us.es>2020-04-01 12:54:37 +0200
commit6a68c4cbb3943263961aee0da6916f92f25e666a (patch)
tree5985c96ce372eb4c056bd14d43e2d52bae14ccbb
parent9bdd4aa13dd8601a517334bf653da07237d465f7 (diff)
#839: Fix bug when creating database event.
-rw-r--r--admin/WebConsole/rest/remotepc.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/admin/WebConsole/rest/remotepc.php b/admin/WebConsole/rest/remotepc.php
index c6dcda51..f8f3af75 100644
--- a/admin/WebConsole/rest/remotepc.php
+++ b/admin/WebConsole/rest/remotepc.php
@@ -187,20 +187,19 @@ EOD;
CREATE EVENT e_timeout_$clntid
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL $timeout DO
BEGIN
- SET @clntid = NULL;
+ SET @action_id = NULL;
UPDATE acciones
SET estado = $ACCION_FINALIZADA, resultado = $ACCION_FALLIDA,
descrinotificacion = 'Timeout'
WHERE descriaccion = 'RemotePC Session' AND estado = $ACCION_INICIADA
- AND idordenador = (SELECT @clntid := '$clntid');
- IF @clntid IS NOT NULL THEN
+ AND idordenador = '$clntid'
+ AND (SELECT @action_id := idaccion);
+ IF @action_id IS NOT NULL THEN
UPDATE remotepc
SET reserved=NOW() - INTERVAL 1 SECOND, urllogin=NULL, urllogout=NULL
- WHERE id = @clntid;
+ WHERE id = '$clntid';
DELETE FROM acciones
- WHERE idordenador = @clntid
- AND descriaccion = 'RemotePC Session'
- AND descrinotificacion = 'Timeout';
+ WHERE idaccion = @action_id;
END IF;
END
EOD;