aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/ApiBundle/Controller/DeveloperController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php24
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/ExportController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/RssController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/SiteCredentialController.php15
-rw-r--r--src/Wallabag/CoreBundle/Controller/StaticController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/TagController.php2
-rw-r--r--src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php8
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml29
-rw-r--r--src/Wallabag/ImportBundle/Controller/BrowserController.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/ChromeController.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/FirefoxController.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/ImportController.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/InstapaperController.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/PinboardController.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/PocketController.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/ReadabilityController.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php2
-rw-r--r--src/Wallabag/ImportBundle/Resources/config/services.yml8
-rw-r--r--src/Wallabag/UserBundle/Controller/ManageController.php12
-rw-r--r--src/Wallabag/UserBundle/EventListener/CreateConfigListener.php7
-rw-r--r--src/Wallabag/UserBundle/Resources/config/services.yml1
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig1
-rw-r--r--src/Wallabag/UserBundle/Resources/views/layout.html.twig5
26 files changed, 101 insertions, 41 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/DeveloperController.php b/src/Wallabag/ApiBundle/Controller/DeveloperController.php
index c7178017..ae7e83da 100644
--- a/src/Wallabag/ApiBundle/Controller/DeveloperController.php
+++ b/src/Wallabag/ApiBundle/Controller/DeveloperController.php
@@ -2,9 +2,9 @@
2 2
3namespace Wallabag\ApiBundle\Controller; 3namespace Wallabag\ApiBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\Routing\Annotation\Route;
8use Wallabag\ApiBundle\Entity\Client; 8use Wallabag\ApiBundle\Entity\Client;
9use Wallabag\ApiBundle\Form\Type\ClientType; 9use Wallabag\ApiBundle\Form\Type\ClientType;
10 10
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index b999c539..be6feb7c 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -2,12 +2,13 @@
2 2
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\JsonResponse; 6use Symfony\Component\HttpFoundation\JsonResponse;
8use Symfony\Component\HttpFoundation\RedirectResponse; 7use Symfony\Component\HttpFoundation\RedirectResponse;
9use Symfony\Component\HttpFoundation\Request; 8use Symfony\Component\HttpFoundation\Request;
10use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; 9use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
10use Symfony\Component\Routing\Annotation\Route;
11use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
11use Wallabag\CoreBundle\Entity\Config; 12use Wallabag\CoreBundle\Entity\Config;
12use Wallabag\CoreBundle\Entity\TaggingRule; 13use Wallabag\CoreBundle\Entity\TaggingRule;
13use Wallabag\CoreBundle\Form\Type\ChangePasswordType; 14use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
@@ -330,6 +331,27 @@ class ConfigController extends Controller
330 } 331 }
331 332
332 /** 333 /**
334 * Change the locale for the current user.
335 *
336 * @param Request $request
337 * @param string $language
338 *
339 * @Route("/locale/{language}", name="changeLocale")
340 *
341 * @return \Symfony\Component\HttpFoundation\RedirectResponse
342 */
343 public function setLocaleAction(Request $request, $language = null)
344 {
345 $errors = $this->get('validator')->validate($language, (new LocaleConstraint()));
346
347 if (0 === \count($errors)) {
348 $request->getSession()->set('_locale', $language);
349 }
350
351 return $this->redirect($request->headers->get('referer', $this->generateUrl('homepage')));
352 }
353
354 /**
333 * Remove all tags for given tags and a given user and cleanup orphan tags. 355 * Remove all tags for given tags and a given user and cleanup orphan tags.
334 * 356 *
335 * @param array $tags 357 * @param array $tags
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 29400833..ac372a33 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -5,9 +5,9 @@ namespace Wallabag\CoreBundle\Controller;
5use Pagerfanta\Adapter\DoctrineORMAdapter; 5use Pagerfanta\Adapter\DoctrineORMAdapter;
6use Pagerfanta\Exception\OutOfRangeCurrentPageException; 6use Pagerfanta\Exception\OutOfRangeCurrentPageException;
7use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; 7use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
8use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
9use Symfony\Bundle\FrameworkBundle\Controller\Controller; 8use Symfony\Bundle\FrameworkBundle\Controller\Controller;
10use Symfony\Component\HttpFoundation\Request; 9use Symfony\Component\HttpFoundation\Request;
10use Symfony\Component\Routing\Annotation\Route;
11use Symfony\Component\Routing\Generator\UrlGeneratorInterface; 11use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
12use Wallabag\CoreBundle\Entity\Entry; 12use Wallabag\CoreBundle\Entity\Entry;
13use Wallabag\CoreBundle\Event\EntryDeletedEvent; 13use Wallabag\CoreBundle\Event\EntryDeletedEvent;
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php
index 7ca89239..0d2b15c5 100644
--- a/src/Wallabag/CoreBundle/Controller/ExportController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExportController.php
@@ -2,10 +2,10 @@
2 2
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 7use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
8use Symfony\Component\Routing\Annotation\Route;
9use Wallabag\CoreBundle\Entity\Entry; 9use Wallabag\CoreBundle\Entity\Entry;
10 10
11/** 11/**
diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php
index 848bb814..1c831c03 100644
--- a/src/Wallabag/CoreBundle/Controller/RssController.php
+++ b/src/Wallabag/CoreBundle/Controller/RssController.php
@@ -7,10 +7,10 @@ use Pagerfanta\Adapter\DoctrineORMAdapter;
7use Pagerfanta\Exception\OutOfRangeCurrentPageException; 7use Pagerfanta\Exception\OutOfRangeCurrentPageException;
8use Pagerfanta\Pagerfanta; 8use Pagerfanta\Pagerfanta;
9use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; 9use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
10use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
11use Symfony\Bundle\FrameworkBundle\Controller\Controller; 10use Symfony\Bundle\FrameworkBundle\Controller\Controller;
12use Symfony\Component\HttpFoundation\Request; 11use Symfony\Component\HttpFoundation\Request;
13use Symfony\Component\HttpFoundation\Response; 12use Symfony\Component\HttpFoundation\Response;
13use Symfony\Component\Routing\Annotation\Route;
14use Symfony\Component\Routing\Generator\UrlGeneratorInterface; 14use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
15use Wallabag\CoreBundle\Entity\Tag; 15use Wallabag\CoreBundle\Entity\Tag;
16use Wallabag\UserBundle\Entity\User; 16use Wallabag\UserBundle\Entity\User;
diff --git a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
index 548de744..51bc1d94 100644
--- a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
+++ b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
@@ -2,10 +2,9 @@
2 2
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
6use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\Routing\Annotation\Route;
9use Wallabag\CoreBundle\Entity\SiteCredential; 8use Wallabag\CoreBundle\Entity\SiteCredential;
10use Wallabag\UserBundle\Entity\User; 9use Wallabag\UserBundle\Entity\User;
11 10
@@ -19,8 +18,7 @@ class SiteCredentialController extends Controller
19 /** 18 /**
20 * Lists all User entities. 19 * Lists all User entities.
21 * 20 *
22 * @Route("/", name="site_credentials_index") 21 * @Route("/", name="site_credentials_index", methods={"GET"})
23 * @Method("GET")
24 */ 22 */
25 public function indexAction() 23 public function indexAction()
26 { 24 {
@@ -36,8 +34,7 @@ class SiteCredentialController extends Controller
36 /** 34 /**
37 * Creates a new site credential entity. 35 * Creates a new site credential entity.
38 * 36 *
39 * @Route("/new", name="site_credentials_new") 37 * @Route("/new", name="site_credentials_new", methods={"GET", "POST"})
40 * @Method({"GET", "POST"})
41 * 38 *
42 * @param Request $request 39 * @param Request $request
43 * 40 *
@@ -77,8 +74,7 @@ class SiteCredentialController extends Controller
77 /** 74 /**
78 * Displays a form to edit an existing site credential entity. 75 * Displays a form to edit an existing site credential entity.
79 * 76 *
80 * @Route("/{id}/edit", name="site_credentials_edit") 77 * @Route("/{id}/edit", name="site_credentials_edit", methods={"GET", "POST"})
81 * @Method({"GET", "POST"})
82 * 78 *
83 * @param Request $request 79 * @param Request $request
84 * @param SiteCredential $siteCredential 80 * @param SiteCredential $siteCredential
@@ -121,8 +117,7 @@ class SiteCredentialController extends Controller
121 /** 117 /**
122 * Deletes a site credential entity. 118 * Deletes a site credential entity.
123 * 119 *
124 * @Route("/{id}", name="site_credentials_delete") 120 * @Route("/{id}", name="site_credentials_delete", methods={"DELETE"})
125 * @Method("DELETE")
126 * 121 *
127 * @param Request $request 122 * @param Request $request
128 * @param SiteCredential $siteCredential 123 * @param SiteCredential $siteCredential
diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php
index 318af303..fa760c14 100644
--- a/src/Wallabag/CoreBundle/Controller/StaticController.php
+++ b/src/Wallabag/CoreBundle/Controller/StaticController.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6use Symfony\Component\Routing\Annotation\Route;
7 7
8class StaticController extends Controller 8class StaticController extends Controller
9{ 9{
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php
index a041510d..d0155c60 100644
--- a/src/Wallabag/CoreBundle/Controller/TagController.php
+++ b/src/Wallabag/CoreBundle/Controller/TagController.php
@@ -5,9 +5,9 @@ namespace Wallabag\CoreBundle\Controller;
5use Pagerfanta\Adapter\ArrayAdapter; 5use Pagerfanta\Adapter\ArrayAdapter;
6use Pagerfanta\Exception\OutOfRangeCurrentPageException; 6use Pagerfanta\Exception\OutOfRangeCurrentPageException;
7use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; 7use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
8use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
9use Symfony\Bundle\FrameworkBundle\Controller\Controller; 8use Symfony\Bundle\FrameworkBundle\Controller\Controller;
10use Symfony\Component\HttpFoundation\Request; 9use Symfony\Component\HttpFoundation\Request;
10use Symfony\Component\Routing\Annotation\Route;
11use Wallabag\CoreBundle\Entity\Entry; 11use Wallabag\CoreBundle\Entity\Entry;
12use Wallabag\CoreBundle\Entity\Tag; 12use Wallabag\CoreBundle\Entity\Tag;
13use Wallabag\CoreBundle\Form\Type\NewTagType; 13use Wallabag\CoreBundle\Form\Type\NewTagType;
diff --git a/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php b/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php
index 367cdfb0..dc1db5c7 100644
--- a/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php
+++ b/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php
@@ -6,8 +6,10 @@ use Symfony\Component\HttpFoundation\Session\Session;
6use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; 6use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
7 7
8/** 8/**
9 * Stores the locale of the user in the session after the 9 * Stores the locale of the user in the session after the login.
10 * login. This can be used by the LocaleListener afterwards. 10 * If no locale are defined (if user doesn't change it from the login screen), override it with the user's config one.
11 *
12 * This can be used by the LocaleListener afterwards.
11 * 13 *
12 * @see http://symfony.com/doc/master/cookbook/session/locale_sticky_session.html 14 * @see http://symfony.com/doc/master/cookbook/session/locale_sticky_session.html
13 */ 15 */
@@ -30,7 +32,7 @@ class UserLocaleListener
30 { 32 {
31 $user = $event->getAuthenticationToken()->getUser(); 33 $user = $event->getAuthenticationToken()->getUser();
32 34
33 if (null !== $user->getConfig()->getLanguage()) { 35 if (null !== $user->getConfig()->getLanguage() && null === $this->session->get('_locale')) {
34 $this->session->set('_locale', $user->getConfig()->getLanguage()); 36 $this->session->set('_locale', $user->getConfig()->getLanguage());
35 } 37 }
36 } 38 }
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 85306276..a27dd210 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -181,6 +181,7 @@ services:
181 181
182 wallabag_core.exception_controller: 182 wallabag_core.exception_controller:
183 class: Wallabag\CoreBundle\Controller\ExceptionController 183 class: Wallabag\CoreBundle\Controller\ExceptionController
184 public: true
184 arguments: 185 arguments:
185 - '@twig' 186 - '@twig'
186 - '%kernel.debug%' 187 - '%kernel.debug%'
@@ -218,3 +219,31 @@ services:
218 arguments: 219 arguments:
219 - "%wallabag_core.site_credentials.encryption_key_path%" 220 - "%wallabag_core.site_credentials.encryption_key_path%"
220 - "@logger" 221 - "@logger"
222
223 wallabag_core.command.clean_duplicates:
224 class: Wallabag\CoreBundle\Command\CleanDuplicatesCommand
225 tags: ['console.command']
226
227 wallabag_core.command.export:
228 class: Wallabag\CoreBundle\Command\ExportCommand
229 tags: ['console.command']
230
231 wallabag_core.command.install:
232 class: Wallabag\CoreBundle\Command\InstallCommand
233 tags: ['console.command']
234
235 wallabag_core.command.list_user:
236 class: Wallabag\CoreBundle\Command\ListUserCommand
237 tags: ['console.command']
238
239 wallabag_core.command.reload_entry:
240 class: Wallabag\CoreBundle\Command\ReloadEntryCommand
241 tags: ['console.command']
242
243 wallabag_core.command.show_user:
244 class: Wallabag\CoreBundle\Command\ShowUserCommand
245 tags: ['console.command']
246
247 wallabag_core.command.tag_all:
248 class: Wallabag\CoreBundle\Command\TagAllCommand
249 tags: ['console.command']
diff --git a/src/Wallabag/ImportBundle/Controller/BrowserController.php b/src/Wallabag/ImportBundle/Controller/BrowserController.php
index 6418925c..58d2a730 100644
--- a/src/Wallabag/ImportBundle/Controller/BrowserController.php
+++ b/src/Wallabag/ImportBundle/Controller/BrowserController.php
@@ -2,10 +2,10 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpFoundation\Response; 7use Symfony\Component\HttpFoundation\Response;
8use Symfony\Component\Routing\Annotation\Route;
9use Wallabag\ImportBundle\Form\Type\UploadImportType; 9use Wallabag\ImportBundle\Form\Type\UploadImportType;
10 10
11abstract class BrowserController extends Controller 11abstract class BrowserController extends Controller
diff --git a/src/Wallabag/ImportBundle/Controller/ChromeController.php b/src/Wallabag/ImportBundle/Controller/ChromeController.php
index 0cb418a1..6628cdb0 100644
--- a/src/Wallabag/ImportBundle/Controller/ChromeController.php
+++ b/src/Wallabag/ImportBundle/Controller/ChromeController.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Component\HttpFoundation\Request; 5use Symfony\Component\HttpFoundation\Request;
6use Symfony\Component\Routing\Annotation\Route;
7 7
8class ChromeController extends BrowserController 8class ChromeController extends BrowserController
9{ 9{
diff --git a/src/Wallabag/ImportBundle/Controller/FirefoxController.php b/src/Wallabag/ImportBundle/Controller/FirefoxController.php
index 88697f9d..dce8455f 100644
--- a/src/Wallabag/ImportBundle/Controller/FirefoxController.php
+++ b/src/Wallabag/ImportBundle/Controller/FirefoxController.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Component\HttpFoundation\Request; 5use Symfony\Component\HttpFoundation\Request;
6use Symfony\Component\Routing\Annotation\Route;
7 7
8class FirefoxController extends BrowserController 8class FirefoxController extends BrowserController
9{ 9{
diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php
index 7e4fd174..fbd7434e 100644
--- a/src/Wallabag/ImportBundle/Controller/ImportController.php
+++ b/src/Wallabag/ImportBundle/Controller/ImportController.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6use Symfony\Component\Routing\Annotation\Route;
7 7
8class ImportController extends Controller 8class ImportController extends Controller
9{ 9{
diff --git a/src/Wallabag/ImportBundle/Controller/InstapaperController.php b/src/Wallabag/ImportBundle/Controller/InstapaperController.php
index f184baf9..faed3b72 100644
--- a/src/Wallabag/ImportBundle/Controller/InstapaperController.php
+++ b/src/Wallabag/ImportBundle/Controller/InstapaperController.php
@@ -2,9 +2,9 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\Routing\Annotation\Route;
8use Wallabag\ImportBundle\Form\Type\UploadImportType; 8use Wallabag\ImportBundle\Form\Type\UploadImportType;
9 9
10class InstapaperController extends Controller 10class InstapaperController extends Controller
diff --git a/src/Wallabag/ImportBundle/Controller/PinboardController.php b/src/Wallabag/ImportBundle/Controller/PinboardController.php
index 6f54c69a..cc6fae79 100644
--- a/src/Wallabag/ImportBundle/Controller/PinboardController.php
+++ b/src/Wallabag/ImportBundle/Controller/PinboardController.php
@@ -2,9 +2,9 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\Routing\Annotation\Route;
8use Wallabag\ImportBundle\Form\Type\UploadImportType; 8use Wallabag\ImportBundle\Form\Type\UploadImportType;
9 9
10class PinboardController extends Controller 10class PinboardController extends Controller
diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php
index 9f28819a..71ceb427 100644
--- a/src/Wallabag/ImportBundle/Controller/PocketController.php
+++ b/src/Wallabag/ImportBundle/Controller/PocketController.php
@@ -2,10 +2,10 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\Form\Extension\Core\Type\CheckboxType; 6use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
8use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\Routing\Annotation\Route;
9use Symfony\Component\Routing\Generator\UrlGeneratorInterface; 9use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
10 10
11class PocketController extends Controller 11class PocketController extends Controller
diff --git a/src/Wallabag/ImportBundle/Controller/ReadabilityController.php b/src/Wallabag/ImportBundle/Controller/ReadabilityController.php
index 729a97a3..b120ef96 100644
--- a/src/Wallabag/ImportBundle/Controller/ReadabilityController.php
+++ b/src/Wallabag/ImportBundle/Controller/ReadabilityController.php
@@ -2,9 +2,9 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\Routing\Annotation\Route;
8use Wallabag\ImportBundle\Form\Type\UploadImportType; 8use Wallabag\ImportBundle\Form\Type\UploadImportType;
9 9
10class ReadabilityController extends Controller 10class ReadabilityController extends Controller
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
index d700d8a8..e1c35343 100644
--- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
+++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Component\HttpFoundation\Request; 5use Symfony\Component\HttpFoundation\Request;
6use Symfony\Component\Routing\Annotation\Route;
7 7
8class WallabagV1Controller extends WallabagController 8class WallabagV1Controller extends WallabagController
9{ 9{
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php
index ab26400c..c4116c1d 100644
--- a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php
+++ b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Component\HttpFoundation\Request; 5use Symfony\Component\HttpFoundation\Request;
6use Symfony\Component\Routing\Annotation\Route;
7 7
8class WallabagV2Controller extends WallabagController 8class WallabagV2Controller extends WallabagController
9{ 9{
diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml
index b224a6a2..2dd7dff8 100644
--- a/src/Wallabag/ImportBundle/Resources/config/services.yml
+++ b/src/Wallabag/ImportBundle/Resources/config/services.yml
@@ -112,3 +112,11 @@ services:
112 - [ setLogger, [ "@logger" ]] 112 - [ setLogger, [ "@logger" ]]
113 tags: 113 tags:
114 - { name: wallabag_import.import, alias: chrome } 114 - { name: wallabag_import.import, alias: chrome }
115
116 wallabag_import.command.import:
117 class: Wallabag\ImportBundle\Command\ImportCommand
118 tags: ['console.command']
119
120 wallabag_import.command.redis_worker:
121 class: Wallabag\ImportBundle\Command\RedisWorkerCommand
122 tags: ['console.command']
diff --git a/src/Wallabag/UserBundle/Controller/ManageController.php b/src/Wallabag/UserBundle/Controller/ManageController.php
index f3de656f..a9746fb4 100644
--- a/src/Wallabag/UserBundle/Controller/ManageController.php
+++ b/src/Wallabag/UserBundle/Controller/ManageController.php
@@ -7,10 +7,9 @@ use FOS\UserBundle\FOSUserEvents;
7use Pagerfanta\Adapter\DoctrineORMAdapter; 7use Pagerfanta\Adapter\DoctrineORMAdapter;
8use Pagerfanta\Exception\OutOfRangeCurrentPageException; 8use Pagerfanta\Exception\OutOfRangeCurrentPageException;
9use Pagerfanta\Pagerfanta; 9use Pagerfanta\Pagerfanta;
10use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
11use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
12use Symfony\Bundle\FrameworkBundle\Controller\Controller; 10use Symfony\Bundle\FrameworkBundle\Controller\Controller;
13use Symfony\Component\HttpFoundation\Request; 11use Symfony\Component\HttpFoundation\Request;
12use Symfony\Component\Routing\Annotation\Route;
14use Wallabag\UserBundle\Entity\User; 13use Wallabag\UserBundle\Entity\User;
15use Wallabag\UserBundle\Form\SearchUserType; 14use Wallabag\UserBundle\Form\SearchUserType;
16 15
@@ -22,8 +21,7 @@ class ManageController extends Controller
22 /** 21 /**
23 * Creates a new User entity. 22 * Creates a new User entity.
24 * 23 *
25 * @Route("/new", name="user_new") 24 * @Route("/new", name="user_new", methods={"GET", "POST"})
26 * @Method({"GET", "POST"})
27 */ 25 */
28 public function newAction(Request $request) 26 public function newAction(Request $request)
29 { 27 {
@@ -60,8 +58,7 @@ class ManageController extends Controller
60 /** 58 /**
61 * Displays a form to edit an existing User entity. 59 * Displays a form to edit an existing User entity.
62 * 60 *
63 * @Route("/{id}/edit", name="user_edit") 61 * @Route("/{id}/edit", name="user_edit", methods={"GET", "POST"})
64 * @Method({"GET", "POST"})
65 */ 62 */
66 public function editAction(Request $request, User $user) 63 public function editAction(Request $request, User $user)
67 { 64 {
@@ -93,8 +90,7 @@ class ManageController extends Controller
93 /** 90 /**
94 * Deletes a User entity. 91 * Deletes a User entity.
95 * 92 *
96 * @Route("/{id}", name="user_delete") 93 * @Route("/{id}", name="user_delete", methods={"DELETE"})
97 * @Method("DELETE")
98 */ 94 */
99 public function deleteAction(Request $request, User $user) 95 public function deleteAction(Request $request, User $user)
100 { 96 {
diff --git a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
index e4d55c19..5cabfd35 100644
--- a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
+++ b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
@@ -6,6 +6,7 @@ use Doctrine\ORM\EntityManager;
6use FOS\UserBundle\Event\UserEvent; 6use FOS\UserBundle\Event\UserEvent;
7use FOS\UserBundle\FOSUserEvents; 7use FOS\UserBundle\FOSUserEvents;
8use Symfony\Component\EventDispatcher\EventSubscriberInterface; 8use Symfony\Component\EventDispatcher\EventSubscriberInterface;
9use Symfony\Component\HttpFoundation\Session\Session;
9use Wallabag\CoreBundle\Entity\Config; 10use Wallabag\CoreBundle\Entity\Config;
10 11
11/** 12/**
@@ -22,8 +23,9 @@ class CreateConfigListener implements EventSubscriberInterface
22 private $readingSpeed; 23 private $readingSpeed;
23 private $actionMarkAsRead; 24 private $actionMarkAsRead;
24 private $listMode; 25 private $listMode;
26 private $session;
25 27
26 public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode) 28 public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode, Session $session)
27 { 29 {
28 $this->em = $em; 30 $this->em = $em;
29 $this->theme = $theme; 31 $this->theme = $theme;
@@ -33,6 +35,7 @@ class CreateConfigListener implements EventSubscriberInterface
33 $this->readingSpeed = $readingSpeed; 35 $this->readingSpeed = $readingSpeed;
34 $this->actionMarkAsRead = $actionMarkAsRead; 36 $this->actionMarkAsRead = $actionMarkAsRead;
35 $this->listMode = $listMode; 37 $this->listMode = $listMode;
38 $this->session = $session;
36 } 39 }
37 40
38 public static function getSubscribedEvents() 41 public static function getSubscribedEvents()
@@ -52,7 +55,7 @@ class CreateConfigListener implements EventSubscriberInterface
52 $config->setTheme($this->theme); 55 $config->setTheme($this->theme);
53 $config->setItemsPerPage($this->itemsOnPage); 56 $config->setItemsPerPage($this->itemsOnPage);
54 $config->setRssLimit($this->rssLimit); 57 $config->setRssLimit($this->rssLimit);
55 $config->setLanguage($this->language); 58 $config->setLanguage($this->session->get('_locale', $this->language));
56 $config->setReadingSpeed($this->readingSpeed); 59 $config->setReadingSpeed($this->readingSpeed);
57 $config->setActionMarkAsRead($this->actionMarkAsRead); 60 $config->setActionMarkAsRead($this->actionMarkAsRead);
58 $config->setListMode($this->listMode); 61 $config->setListMode($this->listMode);
diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml
index d3925de3..72cda3f8 100644
--- a/src/Wallabag/UserBundle/Resources/config/services.yml
+++ b/src/Wallabag/UserBundle/Resources/config/services.yml
@@ -33,6 +33,7 @@ services:
33 - "%wallabag_core.reading_speed%" 33 - "%wallabag_core.reading_speed%"
34 - "%wallabag_core.action_mark_as_read%" 34 - "%wallabag_core.action_mark_as_read%"
35 - "%wallabag_core.list_mode%" 35 - "%wallabag_core.list_mode%"
36 - "@session"
36 tags: 37 tags:
37 - { name: kernel.event_subscriber } 38 - { name: kernel.event_subscriber }
38 39
diff --git a/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig b/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig
index d0a85fc7..85cd4f0d 100644
--- a/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig
@@ -3,7 +3,6 @@
3{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }} 3{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }}
4 <div class="card-content"> 4 <div class="card-content">
5 <div class="row"> 5 <div class="row">
6
7 {{ form_widget(form._token) }} 6 {{ form_widget(form._token) }}
8 7
9 {% for flashMessage in app.session.flashbag.get('notice') %} 8 {% for flashMessage in app.session.flashbag.get('notice') %}
diff --git a/src/Wallabag/UserBundle/Resources/views/layout.html.twig b/src/Wallabag/UserBundle/Resources/views/layout.html.twig
index 99bf7dfd..b53f8746 100644
--- a/src/Wallabag/UserBundle/Resources/views/layout.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/layout.html.twig
@@ -15,6 +15,11 @@
15 {% block fos_user_content %} 15 {% block fos_user_content %}
16 {% endblock fos_user_content %} 16 {% endblock fos_user_content %}
17 </div> 17 </div>
18 <div class="center">
19 <a href="{{ path('changeLocale', {'language': 'de'}) }}">Deutsch</a> –
20 <a href="{{ path('changeLocale', {'language': 'en'}) }}">English</a> –
21 <a href="{{ path('changeLocale', {'language': 'fr'}) }}">Français</a>
22 </div>
18 </div> 23 </div>
19</main> 24</main>
20{% endblock %} 25{% endblock %}