UserController: Use proper redirect urls when adding and removing users

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-20 13:54:05 +02:00
parent fecf7a52b0
commit f86a05e0c3
1 changed files with 5 additions and 1 deletions

View File

@ -11,6 +11,7 @@ use Icinga\Forms\Config\UserForm;
use Icinga\Web\Controller;
use Icinga\Web\Form;
use Icinga\Web\Notification;
use Icinga\Web\Url;
use Icinga\Web\Widget;
class UserController extends Controller
@ -106,8 +107,10 @@ class UserController extends Controller
*/
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;
@ -148,6 +151,7 @@ class UserController extends Controller
}
$form = new UserForm();
$form->setRedirectUrl(Url::fromPath('user/list', array('backend' => $backend->getName())));
$form->setRepository($backend);
$form->remove($userName)->handleRequest();