| @@ 266-278 (lines=13) @@ | ||
| 263 | ); |
|
| 264 | } |
|
| 265 | ||
| 266 | if (!$this->error) { |
|
| 267 | /** @var GroupServiceInterface $groupService */ |
|
| 268 | $groupService = $this->get('twomartens.core.group'); |
|
| 269 | $objectManager->remove($group); |
|
| 270 | $groupService->commitChanges(); |
|
| 271 | $objectManager->flush(); |
|
| 272 | ||
| 273 | // reauthenticate token to update roles |
|
| 274 | /** @var TokenInterface $token */ |
|
| 275 | $token = $this->container->get('security.token_storage')->getToken(); |
|
| 276 | $token->setAuthenticated(false); |
|
| 277 | $this->success = true; |
|
| 278 | } |
|
| 279 | ||
| 280 | return $this->listAction(); |
|
| 281 | } |
|
| @@ 178-191 (lines=14) @@ | ||
| 175 | ||
| 176 | $form->handleRequest($request); |
|
| 177 | ||
| 178 | if ($form->isValid()) { |
|
| 179 | $this->updateGroupAssignment($form, $user); |
|
| 180 | ||
| 181 | // updates the canonical fields, the password and flushes the changes |
|
| 182 | /** @var UserManager $userManager */ |
|
| 183 | $userManager = $this->get('fos_user.user_manager'); |
|
| 184 | $userManager->updateUser($user); |
|
| 185 | ||
| 186 | // reauthenticate token to update roles |
|
| 187 | /** @var TokenInterface $token */ |
|
| 188 | $token = $this->container->get('security.token_storage')->getToken(); |
|
| 189 | $token->setAuthenticated(false); |
|
| 190 | $this->success = true; |
|
| 191 | } |
|
| 192 | ||
| 193 | $this->assignVariables(); |
|
| 194 | $this->templateVariables['form'] = $form->createView(); |
|