CommandActions: Expect an explicit redirect url

This commit is contained in:
Johannes Meyer 2019-10-24 14:57:54 +02:00 committed by Eric Lippmann
parent 132047934d
commit 57a874df37

View file

@ -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()));
}