+ return $this->redirect($this->generateUrl('config').'#set2');
+ }
+
+ // handle tagging rule
+ $taggingRule = new TaggingRule();
+ $newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, array('action' => $this->generateUrl('config').'#set5'));
+ $newTaggingRule->handleRequest($request);
+
+ if ($newTaggingRule->isValid()) {
+ $taggingRule->setConfig($config);
+ $em->persist($taggingRule);
+ $em->flush();
+
+ $this->get('session')->getFlashBag()->add(
+ 'notice',
+ 'flashes.config.notice.tagging_rules_updated'
+ );
+
+ return $this->redirect($this->generateUrl('config').'#set5');
+ }
+
+ // handle adding new user
+ $newUser = $userManager->createUser();
+ // enable created user by default
+ $newUser->setEnabled(true);
+ $newUserForm = $this->createForm(NewUserType::class, $newUser, array(
+ 'validation_groups' => array('Profile'),
+ 'action' => $this->generateUrl('config').'#set6',
+ ));
+ $newUserForm->handleRequest($request);
+
+ if ($newUserForm->isValid() && $this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) {
+ $userManager->updateUser($newUser, true);
+
+ $config = new Config($newUser);
+ $config->setTheme($this->getParameter('wallabag_core.theme'));
+ $config->setItemsPerPage($this->getParameter('wallabag_core.items_on_page'));
+ $config->setRssLimit($this->getParameter('wallabag_core.rss_limit'));
+ $config->setLanguage($this->getParameter('wallabag_core.language'));
+
+ $em->persist($config);
+
+ $em->flush();
+
+ $this->get('session')->getFlashBag()->add(
+ 'notice',
+ $this->get('translator')->trans('flashes.config.notice.user_added', array('%username%' => $newUser->getUsername()))
+ );
+
+ return $this->redirect($this->generateUrl('config').'#set6');