diff options
author | Joas Schilling <coding@schilljs.com> | 2019-01-30 17:44:34 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-02-20 14:17:35 +0300 |
commit | 18aa82dabf3a00d34ce4e17010fd9bd67e0792d3 (patch) | |
tree | ca94214cb1e7c5336925f20b653f10f735c35af1 /lib/Service/CommandService.php | |
parent | dda4b0d4eb4dbb65717d0227a4c737bf6d245d9f (diff) |
Do not allow changing/adding scripts via the Web
It's just too dangerous for now.
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service/CommandService.php')
-rw-r--r-- | lib/Service/CommandService.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Service/CommandService.php b/lib/Service/CommandService.php index 71fa15aeb..593223a0f 100644 --- a/lib/Service/CommandService.php +++ b/lib/Service/CommandService.php @@ -76,6 +76,19 @@ class CommandService { /** * @param int $id + * @param int $response + * @param int $enabled + * @return Command + * @throws \InvalidArgumentException + * @throws DoesNotExistException + */ + public function updateFromWeb(int $id, int $response, int $enabled): Command { + $command = $this->mapper->findById($id); + return $this->update($id, $command->getCommand(), $command->getName(), $command->getScript(), $response, $enabled); + } + + /** + * @param int $id * @param string $cmd * @param string $name * @param string $script |