diff options
author | Simon Rettberg | 2019-12-11 16:33:42 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-12-11 16:33:42 +0100 |
commit | a5eb6f1f99a6e22d3e5461b028aae8a49b23d4e8 (patch) | |
tree | c3f646f8a90c2a8b5146fd81bb8f846656c698f7 /modules-available/rebootcontrol/pages | |
parent | Merge branch 'master' into wol (diff) | |
download | slx-admin-a5eb6f1f99a6e22d3e5461b028aae8a49b23d4e8.tar.gz slx-admin-a5eb6f1f99a6e22d3e5461b028aae8a49b23d4e8.tar.xz slx-admin-a5eb6f1f99a6e22d3e5461b028aae8a49b23d4e8.zip |
[rebootcontrol] Only use Session to pass machine list to exec formwol
Diffstat (limited to 'modules-available/rebootcontrol/pages')
-rw-r--r-- | modules-available/rebootcontrol/pages/exec.inc.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/modules-available/rebootcontrol/pages/exec.inc.php b/modules-available/rebootcontrol/pages/exec.inc.php index 0c40c313..e5fe3cd8 100644 --- a/modules-available/rebootcontrol/pages/exec.inc.php +++ b/modules-available/rebootcontrol/pages/exec.inc.php @@ -13,12 +13,11 @@ class SubPage private static function execExec() { - $id = Request::post('id', Request::REQUIRED, 'int'); - $machines = Session::get('exec-' . $id); - if (!is_array($machines)) { - Message::addError('unknown-exec-job', $id); + $uuids = array_values(Request::post('uuid', Request::REQUIRED, 'array')); + $machines = RebootUtils::getFilteredMachineList($uuids, 'action.exec'); + if (empty($machines)) return; - } + RebootUtils::sortRunningFirst($machines); $script = preg_replace('/\r\n?/', "\n", Request::post('script', Request::REQUIRED, 'string')); $task = RebootControl::runScript($machines, $script); if (Taskmanager::isTask($task)) { @@ -46,6 +45,8 @@ class SubPage Message::addError('unknown-exec-job', $id); return; } + Session::set('exec-' . $id, false); + Session::save(); Render::addTemplate('exec-enter-command', ['clients' => $machines, 'id' => $id]); } |