diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/ParamConverter')
-rw-r--r-- | src/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverter.php (renamed from src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php) | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php b/src/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverter.php index 4a2fcab5..e220abfc 100644 --- a/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php +++ b/src/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverter.php | |||
@@ -10,12 +10,12 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | |||
10 | use Wallabag\UserBundle\Entity\User; | 10 | use Wallabag\UserBundle\Entity\User; |
11 | 11 | ||
12 | /** | 12 | /** |
13 | * ParamConverter used in the RSS controller to retrieve the right user according to | 13 | * ParamConverter used in the Feed controller to retrieve the right user according to |
14 | * username & token given in the url. | 14 | * username & token given in the url. |
15 | * | 15 | * |
16 | * @see http://stfalcon.com/en/blog/post/symfony2-custom-paramconverter | 16 | * @see http://stfalcon.com/en/blog/post/symfony2-custom-paramconverter |
17 | */ | 17 | */ |
18 | class UsernameRssTokenConverter implements ParamConverterInterface | 18 | class UsernameFeedTokenConverter implements ParamConverterInterface |
19 | { | 19 | { |
20 | private $registry; | 20 | private $registry; |
21 | 21 | ||
@@ -67,7 +67,7 @@ class UsernameRssTokenConverter implements ParamConverterInterface | |||
67 | public function apply(Request $request, ParamConverter $configuration) | 67 | public function apply(Request $request, ParamConverter $configuration) |
68 | { | 68 | { |
69 | $username = $request->attributes->get('username'); | 69 | $username = $request->attributes->get('username'); |
70 | $rssToken = $request->attributes->get('token'); | 70 | $feedToken = $request->attributes->get('token'); |
71 | 71 | ||
72 | if (!$request->attributes->has('username') || !$request->attributes->has('token')) { | 72 | if (!$request->attributes->has('username') || !$request->attributes->has('token')) { |
73 | return false; | 73 | return false; |
@@ -78,8 +78,8 @@ class UsernameRssTokenConverter implements ParamConverterInterface | |||
78 | 78 | ||
79 | $userRepository = $em->getRepository($configuration->getClass()); | 79 | $userRepository = $em->getRepository($configuration->getClass()); |
80 | 80 | ||
81 | // Try to find user by its username and config rss_token | 81 | // Try to find user by its username and config feed_token |
82 | $user = $userRepository->findOneByUsernameAndRsstoken($username, $rssToken); | 82 | $user = $userRepository->findOneByUsernameAndFeedtoken($username, $feedToken); |
83 | 83 | ||
84 | if (null === $user || !($user instanceof User)) { | 84 | if (null === $user || !($user instanceof User)) { |
85 | throw new NotFoundHttpException(sprintf('%s not found.', $configuration->getClass())); | 85 | throw new NotFoundHttpException(sprintf('%s not found.', $configuration->getClass())); |