diff options
author | Simon Rettberg | 2020-05-15 17:24:05 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-05-15 17:24:05 +0200 |
commit | 2faaf8383c9c8a1a557518caa9f2284158df523b (patch) | |
tree | 74daaa3fa45f0808df369657d8f6efd54d19ed40 /modules-available/remoteaccess/hooks | |
parent | [rebootcontrol] Wait until tasks finish (diff) | |
download | slx-admin-2faaf8383c9c8a1a557518caa9f2284158df523b.tar.gz slx-admin-2faaf8383c9c8a1a557518caa9f2284158df523b.tar.xz slx-admin-2faaf8383c9c8a1a557518caa9f2284158df523b.zip |
[remoteaccess] New module
Diffstat (limited to 'modules-available/remoteaccess/hooks')
-rw-r--r-- | modules-available/remoteaccess/hooks/client-update.inc.php | 9 | ||||
-rw-r--r-- | modules-available/remoteaccess/hooks/cron.inc.php | 6 |
2 files changed, 15 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]); +} diff --git a/modules-available/remoteaccess/hooks/cron.inc.php b/modules-available/remoteaccess/hooks/cron.inc.php new file mode 100644 index 00000000..3e0e130b --- /dev/null +++ b/modules-available/remoteaccess/hooks/cron.inc.php @@ -0,0 +1,6 @@ +<?php + +if (!Module::isAvailable('rebootcontrol')) + return; + +RemoteAccess::ensureMachinesRunning(); |