use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
- $configForm = $this->createForm('config', $config, array('action' => $this->generateUrl('config')));
+ $configForm = $this->createForm(ConfigType::class, $config, ['action' => $this->generateUrl('config')]);
- $pwdForm = $this->createForm(new ChangePasswordType(), null, array('action' => $this->generateUrl('config').'#set4'));
+ $pwdForm = $this->createForm(ChangePasswordType::class, null, ['action' => $this->generateUrl('config').'#set4']);
- $user->setPlainPassword($pwdForm->get('new_password')->getData());
- $userManager->updateUser($user, true);
+ if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) {
+ $message = 'flashes.config.notice.password_not_updated_demo';
+ } else {
+ $message = 'flashes.config.notice.password_updated';
- $userForm = $this->createForm(new UserInformationType(), $user, array(
- 'validation_groups' => array('Profile'),
+ $userForm = $this->createForm(UserInformationType::class, $user, [
+ 'validation_groups' => ['Profile'],
- $rssForm = $this->createForm(new RssType(), $config, array('action' => $this->generateUrl('config').'#set2'));
+ $rssForm = $this->createForm(RssType::class, $config, ['action' => $this->generateUrl('config').'#set2']);
}
// handle adding new user
$newUser = $userManager->createUser();
// enable created user by default
$newUser->setEnabled(true);
}
// handle adding new user
$newUser = $userManager->createUser();
// enable created user by default
$newUser->setEnabled(true);
- $newUserForm = $this->createForm(new NewUserType(), $newUser, array(
- 'validation_groups' => array('Profile'),
- 'action' => $this->generateUrl('config').'#set5',
- ));
+ $newUserForm = $this->createForm(NewUserType::class, $newUser, [
+ 'validation_groups' => ['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);
$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->container->getParameter('theme'));
- $config->setItemsPerPage($this->container->getParameter('items_on_page'));
- $config->setRssLimit($this->container->getParameter('rss_limit'));
- $config->setLanguage($this->container->getParameter('language'));
+ $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'));
'config' => $configForm->createView(),
'rss' => $rssForm->createView(),
'pwd' => $pwdForm->createView(),
'user' => $userForm->createView(),
'new_user' => $newUserForm->createView(),
'new_tagging_rule' => $newTaggingRule->createView(),
'config' => $configForm->createView(),
'rss' => $rssForm->createView(),
'pwd' => $pwdForm->createView(),
'user' => $userForm->createView(),
'new_user' => $newUserForm->createView(),
'new_tagging_rule' => $newTaggingRule->createView(),
'username' => $user->getUsername(),
'token' => $config->getRssToken(),
'username' => $user->getUsername(),
'token' => $config->getRssToken(),
- return $request->headers->get('referer') ? $this->redirect($request->headers->get('referer')) : $this->redirectToRoute('config');
+ $this->get('session')->getFlashBag()->add(
+ 'notice',
+ 'flashes.config.notice.rss_token_updated'
+ );
+
+ return $this->redirect($this->generateUrl('config').'#set2');
}
/**
* Retrieve config for the current user.
* If no config were found, create a new one.
*
}
/**
* Retrieve config for the current user.
* If no config were found, create a new one.
*