summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/rest/remotepc.php
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2017-05-25 12:47:55 +0000
committerramon <ramongomez@us.es>2017-05-25 12:47:55 +0000
commit0c9d25adf95db8f99bc8e48f3832a3465ed37a7e (patch)
treef4699f14bc9caf96907a5dd30eec83b4a9e67406 /admin/WebConsole/rest/remotepc.php
parent2f110530c9fceb8ec8255570fc6d2f599fea4050 (diff)
#708: Timeout para iniciar equipo reservado (prueba comentada).
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5317 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/rest/remotepc.php')
-rw-r--r--admin/WebConsole/rest/remotepc.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/admin/WebConsole/rest/remotepc.php b/admin/WebConsole/rest/remotepc.php
index d560a09d..7f4fc53d 100644
--- a/admin/WebConsole/rest/remotepc.php
+++ b/admin/WebConsole/rest/remotepc.php
@@ -149,6 +149,28 @@ INSERT INTO acciones
idcentro=$ouid;
EOD;
$t2 = $cmd->Ejecutar();
+ // Delete reservation on timeout (15 min.).
+ $timeout = "15 MINUTE";
+/*
+ $cmd->texto = <<<EOD
+CREATE EVENT e_timeout_$clntid
+ ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL $timeout DO
+ BEGIN
+ SET @clntid = NULL;
+ UPDATE acciones
+ SET estado = $ACCION_FINALIZADA, resultado = $ACCION_FALLIDA,
+ descrinotificacion = 'Timeout'
+ WHERE idordenador = (SELECT @clntid := '$clntid')
+ AND descriaccion = 'RemotePC Session' AND estado = $ACCION_INICIADA;
+ IF @clntid IS NOT NULL THEN
+ UPDATE remotepc
+ SET reserved=NOW() - INTERVAL 1 SECOND, urllogin=NULL, urllogout=NULL
+ WHERE id = @clntid;
+ END IF;
+ END
+EOD;
+ $t3 = $cmd->Ejecutar();
+*/
if ($t1 and $t2) {
// Commit transaction on success.
$cmd->texto = "COMMIT;";