UserForm: Fix redirect when renaming a user

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-22 17:01:34 +02:00
parent 88f5bb8368
commit 18e413d15a
1 changed files with 18 additions and 0 deletions

View File

@ -67,6 +67,24 @@ class UserForm extends RepositoryForm
$this->setSubmitLabel($this->translate('Save'));
}
/**
* Update a user
*
* @return bool
*/
protected function onUpdateSuccess()
{
if (parent::onUpdateSuccess()) {
if (($newName = $this->getValue('user_name')) !== $this->getIdentifier()) {
$this->getRedirectUrl()->setParam('user', $newName);
}
return true;
}
return false;
}
/**
* Retrieve all form element values
*