+ if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) {
+ $message = 'In demonstration mode, you can\'t change password for this user.';
+ } else {
+ $message = 'Password updated';
+
+ $user->setPlainPassword($pwdForm->get('new_password')->getData());
+ $userManager->updateUser($user, true);
+ }
+
+ $this->get('session')->getFlashBag()->add('notice', $message);
+
+ return $this->redirect($this->generateUrl('config').'#set4');
+ }
+
+ // handle changing user information
+ $userForm = $this->createForm(UserInformationType::class, $user, array(
+ 'validation_groups' => array('Profile'),
+ 'action' => $this->generateUrl('config').'#set3',
+ ));
+ $userForm->handleRequest($request);
+
+ if ($userForm->isValid()) {
+ $userManager->updateUser($user, true);
+
+ $this->get('session')->getFlashBag()->add(
+ 'notice',
+ 'Information updated'
+ );
+
+ return $this->redirect($this->generateUrl('config').'#set3');
+ }
+
+ // handle rss information
+ $rssForm = $this->createForm(RssType::class, $config, array('action' => $this->generateUrl('config').'#set2'));
+ $rssForm->handleRequest($request);
+
+ if ($rssForm->isValid()) {
+ $em->persist($config);