summaryrefslogtreecommitdiffstats
path: root/modules-available/remoteaccess/hooks/client-update.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2020-05-15 17:24:05 +0200
committerSimon Rettberg2020-05-15 17:29:16 +0200
commit426e574b85d363cd5a1fa256034dc2a281fc7272 (patch)
treed60738f67176e991dcd84d16079d85ff2168b243 /modules-available/remoteaccess/hooks/client-update.inc.php
parent[rebootcontrol] Wait until tasks finish (diff)
downloadslx-admin-426e574b85d363cd5a1fa256034dc2a281fc7272.tar.gz
slx-admin-426e574b85d363cd5a1fa256034dc2a281fc7272.tar.xz
slx-admin-426e574b85d363cd5a1fa256034dc2a281fc7272.zip
[remoteaccess] New module
Diffstat (limited to 'modules-available/remoteaccess/hooks/client-update.inc.php')
-rw-r--r--modules-available/remoteaccess/hooks/client-update.inc.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules-available/remoteaccess/hooks/client-update.inc.php b/modules-available/remoteaccess/hooks/client-update.inc.php
new file mode 100644
index 00000000..ecf5d91c
--- /dev/null
+++ b/modules-available/remoteaccess/hooks/client-update.inc.php
@@ -0,0 +1,9 @@
+<?php
+
+if ($type === '~poweron') {
+ Database::exec("UPDATE remoteaccess_machine SET password = NULL WHERE machineuuid = :uuid",
+ ['uuid' => $uuid]);
+} elseif ($type === '~poweroff') {
+ Database::exec("UPDATE remoteaccess_machine SET woltime = 0 WHERE machineuuid = :uuid",
+ ['uuid' => $uuid]);
+}