From 57a874df37084fde6cfc428b249e116080d04dfe Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 24 Oct 2019 14:57:54 +0200 Subject: [PATCH] CommandActions: Expect an explicit redirect url --- library/Eagle/Common/CommandActions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Eagle/Common/CommandActions.php b/library/Eagle/Common/CommandActions.php index 781d391c..0cd7c79a 100644 --- a/library/Eagle/Common/CommandActions.php +++ b/library/Eagle/Common/CommandActions.php @@ -25,6 +25,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\ToggleObjectFeaturesCommandFor use ipl\Html\HtmlString; use ipl\Orm\Model; use ipl\Orm\Query; +use ipl\Web\Url; use LogicException; /** @@ -32,6 +33,7 @@ use LogicException; * * @method mixed fetchCommandTargets() Fetch command targets, \ipl\Orm\Query or \ipl\Orm\Model[] * @method object getFeatureStatus() Get status of toggleable features + * @method Url getCommandTargetsUrl() Get url to view command targets, used as redirection target */ trait CommandActions { @@ -114,6 +116,8 @@ trait CommandActions ]); } + $form->setRedirectUrl($this->getCommandTargetsUrl()); + $form->handleRequest(); $this->addContent(HtmlString::create($form->render())); }