Skip to content

Commit

Permalink
UserController: Use proper redirect urls when adding and removing users
Browse files Browse the repository at this point in the history
refs #8826
  • Loading branch information
Johannes Meyer committed May 20, 2015
1 parent fecf7a5 commit f86a05e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion application/controllers/UserController.php
Expand Up @@ -11,6 +11,7 @@
use Icinga\Web\Controller;
use Icinga\Web\Form;
use Icinga\Web\Notification;
use Icinga\Web\Url;
use Icinga\Web\Widget;

class UserController extends Controller
Expand Down Expand Up @@ -106,8 +107,10 @@ function ($b) { return $b->getName(); },
*/
public function addAction()
{
$backend = $this->getUserBackend($this->params->getRequired('backend'), 'Icinga\Data\Extensible');
$form = new UserForm();
$form->setRepository($this->getUserBackend($this->params->getRequired('backend'), 'Icinga\Data\Extensible'));
$form->setRedirectUrl(Url::fromPath('user/list', array('backend' => $backend->getName())));
$form->setRepository($backend);
$form->add()->handleRequest();

$this->view->form = $form;
Expand Down Expand Up @@ -148,6 +151,7 @@ public function removeAction()
}

$form = new UserForm();
$form->setRedirectUrl(Url::fromPath('user/list', array('backend' => $backend->getName())));
$form->setRepository($backend);
$form->remove($userName)->handleRequest();

Expand Down

0 comments on commit f86a05e

Please sign in to comment.