diff options
| author | Udo Walter | 2017-09-01 15:27:06 +0200 |
|---|---|---|
| committer | Udo Walter | 2017-09-01 15:27:06 +0200 |
| commit | 599c259845cd94a0bb64233b9935ea8c38be65b0 (patch) | |
| tree | f6b2601d774aa5a0ca8785015d997545ef9952f7 /modules-available/rebootcontrol/api.inc.php | |
| parent | [js_stupidtable] changed one-line code to formatted code; (diff) | |
| parent | [locationinfo] Add backend for Microsoft Exchange Server (diff) | |
| download | slx-admin-599c259845cd94a0bb64233b9935ea8c38be65b0.tar.gz slx-admin-599c259845cd94a0bb64233b9935ea8c38be65b0.tar.xz slx-admin-599c259845cd94a0bb64233b9935ea8c38be65b0.zip | |
Merge remote-tracking branch 'origin/master' into permission-manager
Diffstat (limited to 'modules-available/rebootcontrol/api.inc.php')
| -rw-r--r-- | modules-available/rebootcontrol/api.inc.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules-available/rebootcontrol/api.inc.php b/modules-available/rebootcontrol/api.inc.php index 77687f8e..dad25375 100644 --- a/modules-available/rebootcontrol/api.inc.php +++ b/modules-available/rebootcontrol/api.inc.php @@ -1,4 +1,13 @@ <?php + +if (Request::any('action') === 'rebuild' && isLocalExecution()) { + if (Module::isAvailable('sysconfig')) { + SSHKey::getPublicKey(); + ConfigTgz::rebuildAllConfigs(); + echo "OK"; + } + exit(0); +} /* Needed POST-Parameters: 'token' -- for authentification @@ -15,7 +24,8 @@ foreach ($ips as $client) { $clients[] = array("ip" => $client); } -if (Request::post('token') == Property::get("rebootcontrol_APIPOSTKEY")) { +$apikey = Property::get("rebootcontrol_APIPOSTKEY", 'not-set'); +if (!empty($apikey) && Request::post('token') === $apikey) { if (Request::isPost()) { if (Request::post('action') == 'shutdown') { $shutdown = true; |
