From 66611d4887f0fc801230c89fce7c9a4cbf2d796c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 20 May 2015 14:06:59 +0200 Subject: [PATCH] GroupController: Use proper redirect urls when adding and removing groups refs #8826 --- application/controllers/GroupController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/GroupController.php b/application/controllers/GroupController.php index 7e30f7ccd..4a0652e4e 100644 --- a/application/controllers/GroupController.php +++ b/application/controllers/GroupController.php @@ -11,6 +11,7 @@ use Icinga\Forms\Config\UserGroupForm; use Icinga\Web\Controller; use Icinga\Web\Form; use Icinga\Web\Notification; +use Icinga\Web\Url; use Icinga\Web\Widget; class GroupController extends Controller @@ -106,10 +107,10 @@ class GroupController extends Controller */ public function addAction() { + $backend = $this->getUserGroupBackend($this->params->getRequired('backend'), 'Icinga\Data\Extensible'); $form = new UserGroupForm(); - $form->setRepository( - $this->getUserGroupBackend($this->params->getRequired('backend'), 'Icinga\Data\Extensible') - ); + $form->setRedirectUrl(Url::fromPath('group/list', array('backend' => $backend->getName()))); + $form->setRepository($backend); $form->add()->handleRequest(); $this->view->form = $form; @@ -150,6 +151,7 @@ class GroupController extends Controller } $form = new UserGroupForm(); + $form->setRedirectUrl(Url::fromPath('group/list', array('backend' => $backend->getName()))); $form->setRepository($backend); $form->remove($groupName)->handleRequest();