aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php6
-rw-r--r--src/Wallabag/CoreBundle/Command/ExportCommand.php5
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php2
-rw-r--r--src/Wallabag/CoreBundle/Command/ShowUserCommand.php2
-rw-r--r--src/Wallabag/CoreBundle/Command/TagAllCommand.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php21
-rw-r--r--src/Wallabag/CoreBundle/Controller/ExportController.php14
-rw-r--r--src/Wallabag/CoreBundle/Controller/RssController.php106
-rw-r--r--src/Wallabag/CoreBundle/Controller/SiteCredentialController.php174
-rw-r--r--src/Wallabag/CoreBundle/Controller/TagController.php20
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php34
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/Configuration.php2
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php1
-rw-r--r--src/Wallabag/CoreBundle/Entity/SiteCredential.php195
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php44
-rw-r--r--src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php42
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php4
-rw-r--r--src/Wallabag/CoreBundle/Helper/CryptoProxy.php86
-rw-r--r--src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php8
-rw-r--r--src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php47
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml17
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml33
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml27
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml33
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml27
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml27
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml43
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.it.yml33
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml35
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml33
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml33
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml33
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml13
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig11
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig13
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/edit.html.twig60
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/index.html.twig42
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/new.html.twig53
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig7
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig3
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig6
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/entries.xml.twig6
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig21
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig16
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/edit.html.twig60
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/index.html.twig42
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/new.html.twig53
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig3
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig5
49 files changed, 1481 insertions, 122 deletions
diff --git a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
index 65f35d8e..74da1e5f 100644
--- a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
+++ b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
@@ -46,7 +46,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
46 return 1; 46 return 1;
47 } 47 }
48 } else { 48 } else {
49 $users = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findAll(); 49 $users = $this->getContainer()->get('wallabag_user.user_repository')->findAll();
50 50
51 $output->writeln(sprintf('Cleaning through %d user accounts', count($users))); 51 $output->writeln(sprintf('Cleaning through %d user accounts', count($users)));
52 52
@@ -66,7 +66,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
66 private function cleanDuplicates(User $user) 66 private function cleanDuplicates(User $user)
67 { 67 {
68 $em = $this->getContainer()->get('doctrine.orm.entity_manager'); 68 $em = $this->getContainer()->get('doctrine.orm.entity_manager');
69 $repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); 69 $repo = $this->getContainer()->get('wallabag_core.entry_repository');
70 70
71 $entries = $repo->getAllEntriesIdAndUrl($user->getId()); 71 $entries = $repo->getAllEntriesIdAndUrl($user->getId());
72 72
@@ -109,7 +109,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
109 */ 109 */
110 private function getUser($username) 110 private function getUser($username)
111 { 111 {
112 return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username); 112 return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
113 } 113 }
114 114
115 private function getDoctrine() 115 private function getDoctrine()
diff --git a/src/Wallabag/CoreBundle/Command/ExportCommand.php b/src/Wallabag/CoreBundle/Command/ExportCommand.php
index e3d3b399..ebb2b4cf 100644
--- a/src/Wallabag/CoreBundle/Command/ExportCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ExportCommand.php
@@ -32,15 +32,14 @@ class ExportCommand extends ContainerAwareCommand
32 protected function execute(InputInterface $input, OutputInterface $output) 32 protected function execute(InputInterface $input, OutputInterface $output)
33 { 33 {
34 try { 34 try {
35 $user = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($input->getArgument('username')); 35 $user = $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($input->getArgument('username'));
36 } catch (NoResultException $e) { 36 } catch (NoResultException $e) {
37 $output->writeln(sprintf('<error>User "%s" not found.</error>', $input->getArgument('username'))); 37 $output->writeln(sprintf('<error>User "%s" not found.</error>', $input->getArgument('username')));
38 38
39 return 1; 39 return 1;
40 } 40 }
41 41
42 $entries = $this->getDoctrine() 42 $entries = $this->getContainer()->get('wallabag_core.entry_repository')
43 ->getRepository('WallabagCoreBundle:Entry')
44 ->getBuilderForAllByUser($user->getId()) 43 ->getBuilderForAllByUser($user->getId())
45 ->getQuery() 44 ->getQuery()
46 ->getResult(); 45 ->getResult();
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 0f119377..eb725a59 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -313,6 +313,8 @@ class InstallCommand extends ContainerAwareCommand
313 313
314 $this 314 $this
315 ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]); 315 ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]);
316
317 return $this;
316 } 318 }
317 319
318 /** 320 /**
diff --git a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php
index 0eeaabc4..eef04988 100644
--- a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php
@@ -67,7 +67,7 @@ class ShowUserCommand extends ContainerAwareCommand
67 */ 67 */
68 private function getUser($username) 68 private function getUser($username)
69 { 69 {
70 return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username); 70 return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
71 } 71 }
72 72
73 private function getDoctrine() 73 private function getDoctrine()
diff --git a/src/Wallabag/CoreBundle/Command/TagAllCommand.php b/src/Wallabag/CoreBundle/Command/TagAllCommand.php
index 3f9bb04d..9843674e 100644
--- a/src/Wallabag/CoreBundle/Command/TagAllCommand.php
+++ b/src/Wallabag/CoreBundle/Command/TagAllCommand.php
@@ -59,7 +59,7 @@ class TagAllCommand extends ContainerAwareCommand
59 */ 59 */
60 private function getUser($username) 60 private function getUser($username)
61 { 61 {
62 return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username); 62 return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
63 } 63 }
64 64
65 private function getDoctrine() 65 private function getDoctrine()
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 89d27425..d4170d39 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -152,8 +152,7 @@ class ConfigController extends Controller
152 ], 152 ],
153 'twofactor_auth' => $this->getParameter('twofactor_auth'), 153 'twofactor_auth' => $this->getParameter('twofactor_auth'),
154 'wallabag_url' => $this->getParameter('domain_name'), 154 'wallabag_url' => $this->getParameter('domain_name'),
155 'enabled_users' => $this->getDoctrine() 155 'enabled_users' => $this->get('wallabag_user.user_repository')
156 ->getRepository('WallabagUserBundle:User')
157 ->getSumEnabledUsers(), 156 ->getSumEnabledUsers(),
158 ]); 157 ]);
159 } 158 }
@@ -257,9 +256,7 @@ class ConfigController extends Controller
257 // manually remove tags to avoid orphan tag 256 // manually remove tags to avoid orphan tag
258 $this->removeAllTagsByUserId($this->getUser()->getId()); 257 $this->removeAllTagsByUserId($this->getUser()->getId());
259 258
260 $this->getDoctrine() 259 $this->get('wallabag_core.entry_repository')->removeAllByUserId($this->getUser()->getId());
261 ->getRepository('WallabagCoreBundle:Entry')
262 ->removeAllByUserId($this->getUser()->getId());
263 break; 260 break;
264 case 'archived': 261 case 'archived':
265 if ($this->get('doctrine')->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) { 262 if ($this->get('doctrine')->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
@@ -269,9 +266,7 @@ class ConfigController extends Controller
269 // manually remove tags to avoid orphan tag 266 // manually remove tags to avoid orphan tag
270 $this->removeTagsForArchivedByUserId($this->getUser()->getId()); 267 $this->removeTagsForArchivedByUserId($this->getUser()->getId());
271 268
272 $this->getDoctrine() 269 $this->get('wallabag_core.entry_repository')->removeArchivedByUserId($this->getUser()->getId());
273 ->getRepository('WallabagCoreBundle:Entry')
274 ->removeArchivedByUserId($this->getUser()->getId());
275 break; 270 break;
276 } 271 }
277 272
@@ -295,8 +290,7 @@ class ConfigController extends Controller
295 return; 290 return;
296 } 291 }
297 292
298 $this->getDoctrine() 293 $this->get('wallabag_core.entry_repository')
299 ->getRepository('WallabagCoreBundle:Entry')
300 ->removeTags($userId, $tags); 294 ->removeTags($userId, $tags);
301 295
302 // cleanup orphan tags 296 // cleanup orphan tags
@@ -318,7 +312,7 @@ class ConfigController extends Controller
318 */ 312 */
319 private function removeAllTagsByUserId($userId) 313 private function removeAllTagsByUserId($userId)
320 { 314 {
321 $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findAllTags($userId); 315 $tags = $this->get('wallabag_core.tag_repository')->findAllTags($userId);
322 $this->removeAllTagsByStatusAndUserId($tags, $userId); 316 $this->removeAllTagsByStatusAndUserId($tags, $userId);
323 } 317 }
324 318
@@ -329,7 +323,7 @@ class ConfigController extends Controller
329 */ 323 */
330 private function removeTagsForArchivedByUserId($userId) 324 private function removeTagsForArchivedByUserId($userId)
331 { 325 {
332 $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findForArchivedArticlesByUser($userId); 326 $tags = $this->get('wallabag_core.tag_repository')->findForArchivedArticlesByUser($userId);
333 $this->removeAllTagsByStatusAndUserId($tags, $userId); 327 $this->removeAllTagsByStatusAndUserId($tags, $userId);
334 } 328 }
335 329
@@ -393,8 +387,7 @@ class ConfigController extends Controller
393 */ 387 */
394 public function deleteAccountAction(Request $request) 388 public function deleteAccountAction(Request $request)
395 { 389 {
396 $enabledUsers = $this->getDoctrine() 390 $enabledUsers = $this->get('wallabag_user.user_repository')
397 ->getRepository('WallabagUserBundle:User')
398 ->getSumEnabledUsers(); 391 ->getSumEnabledUsers();
399 392
400 if ($enabledUsers <= 1) { 393 if ($enabledUsers <= 1) {
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php
index abc3336a..fda04cfb 100644
--- a/src/Wallabag/CoreBundle/Controller/ExportController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExportController.php
@@ -7,7 +7,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 8use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
9use Wallabag\CoreBundle\Entity\Entry; 9use Wallabag\CoreBundle\Entity\Entry;
10use Wallabag\CoreBundle\Entity\Tag;
11 10
12/** 11/**
13 * The try/catch can be removed once all formats will be implemented. 12 * The try/catch can be removed once all formats will be implemented.
@@ -57,16 +56,17 @@ class ExportController extends Controller
57 { 56 {
58 $method = ucfirst($category); 57 $method = ucfirst($category);
59 $methodBuilder = 'getBuilderFor'.$method.'ByUser'; 58 $methodBuilder = 'getBuilderFor'.$method.'ByUser';
59 $repository = $this->get('wallabag_core.entry_repository');
60 60
61 if ($category == 'tag_entries') { 61 if ($category == 'tag_entries') {
62 $tag = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneBySlug($request->query->get('tag')); 62 $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag'));
63 63
64 $entries = $this->getDoctrine() 64 $entries = $repository->findAllByTagId(
65 ->getRepository('WallabagCoreBundle:Entry') 65 $this->getUser()->getId(),
66 ->findAllByTagId($this->getUser()->getId(), $tag->getId()); 66 $tag->getId()
67 );
67 } else { 68 } else {
68 $entries = $this->getDoctrine() 69 $entries = $repository
69 ->getRepository('WallabagCoreBundle:Entry')
70 ->$methodBuilder($this->getUser()->getId()) 70 ->$methodBuilder($this->getUser()->getId())
71 ->getQuery() 71 ->getQuery()
72 ->getResult(); 72 ->getResult();
diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php
index 92f18707..e87dd9a1 100644
--- a/src/Wallabag/CoreBundle/Controller/RssController.php
+++ b/src/Wallabag/CoreBundle/Controller/RssController.php
@@ -3,13 +3,16 @@
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use Pagerfanta\Adapter\DoctrineORMAdapter; 5use Pagerfanta\Adapter\DoctrineORMAdapter;
6use Pagerfanta\Adapter\ArrayAdapter;
6use Pagerfanta\Exception\OutOfRangeCurrentPageException; 7use Pagerfanta\Exception\OutOfRangeCurrentPageException;
7use Pagerfanta\Pagerfanta; 8use Pagerfanta\Pagerfanta;
8use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; 9use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
9use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 10use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
10use Symfony\Component\HttpFoundation\Request; 11use Symfony\Component\HttpFoundation\Request;
12use Symfony\Component\HttpFoundation\Response;
11use Symfony\Bundle\FrameworkBundle\Controller\Controller; 13use Symfony\Bundle\FrameworkBundle\Controller\Controller;
12use Wallabag\CoreBundle\Entity\Entry; 14use Wallabag\CoreBundle\Entity\Entry;
15use Wallabag\CoreBundle\Entity\Tag;
13use Wallabag\UserBundle\Entity\User; 16use Wallabag\UserBundle\Entity\User;
14use Symfony\Component\Routing\Generator\UrlGeneratorInterface; 17use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
15 18
@@ -23,7 +26,7 @@ class RssController extends Controller
23 * 26 *
24 * @return \Symfony\Component\HttpFoundation\Response 27 * @return \Symfony\Component\HttpFoundation\Response
25 */ 28 */
26 public function showUnreadAction(Request $request, User $user) 29 public function showUnreadRSSAction(Request $request, User $user)
27 { 30 {
28 return $this->showEntries('unread', $user, $request->query->get('page', 1)); 31 return $this->showEntries('unread', $user, $request->query->get('page', 1));
29 } 32 }
@@ -31,12 +34,12 @@ class RssController extends Controller
31 /** 34 /**
32 * Shows read entries for current user. 35 * Shows read entries for current user.
33 * 36 *
34 * @Route("/{username}/{token}/archive.xml", name="archive_rss") 37 * @Route("/{username}/{token}/archive.xml", name="archive_rss", defaults={"_format"="xml"})
35 * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter") 38 * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter")
36 * 39 *
37 * @return \Symfony\Component\HttpFoundation\Response 40 * @return \Symfony\Component\HttpFoundation\Response
38 */ 41 */
39 public function showArchiveAction(Request $request, User $user) 42 public function showArchiveRSSAction(Request $request, User $user)
40 { 43 {
41 return $this->showEntries('archive', $user, $request->query->get('page', 1)); 44 return $this->showEntries('archive', $user, $request->query->get('page', 1));
42 } 45 }
@@ -44,17 +47,89 @@ class RssController extends Controller
44 /** 47 /**
45 * Shows starred entries for current user. 48 * Shows starred entries for current user.
46 * 49 *
47 * @Route("/{username}/{token}/starred.xml", name="starred_rss") 50 * @Route("/{username}/{token}/starred.xml", name="starred_rss", defaults={"_format"="xml"})
48 * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter") 51 * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter")
49 * 52 *
50 * @return \Symfony\Component\HttpFoundation\Response 53 * @return \Symfony\Component\HttpFoundation\Response
51 */ 54 */
52 public function showStarredAction(Request $request, User $user) 55 public function showStarredRSSAction(Request $request, User $user)
53 { 56 {
54 return $this->showEntries('starred', $user, $request->query->get('page', 1)); 57 return $this->showEntries('starred', $user, $request->query->get('page', 1));
55 } 58 }
56 59
57 /** 60 /**
61 * Shows all entries for current user.
62 *
63 * @Route("/{username}/{token}/all.xml", name="all_rss", defaults={"_format"="xml"})
64 * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter")
65 *
66 * @return \Symfony\Component\HttpFoundation\Response
67 */
68 public function showAllRSSAction(Request $request, User $user)
69 {
70 return $this->showEntries('all', $user, $request->query->get('page', 1));
71 }
72
73 /**
74 * Shows entries associated to a tag for current user.
75 *
76 * @Route("/{username}/{token}/tags/{slug}.xml", name="tag_rss", defaults={"_format"="xml"})
77 * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter")
78 * @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
79 *
80 * @return \Symfony\Component\HttpFoundation\Response
81 */
82 public function showTagsAction(Request $request, User $user, Tag $tag)
83 {
84 $page = $request->query->get('page', 1);
85
86 $url = $this->generateUrl(
87 'tag_rss',
88 [
89 'username' => $user->getUsername(),
90 'token' => $user->getConfig()->getRssToken(),
91 'slug' => $tag->getSlug(),
92 ],
93 UrlGeneratorInterface::ABSOLUTE_URL
94 );
95
96 $entriesByTag = $this->get('wallabag_core.entry_repository')->findAllByTagId(
97 $user->getId(),
98 $tag->getId()
99 );
100
101 $pagerAdapter = new ArrayAdapter($entriesByTag);
102
103 $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare(
104 $pagerAdapter,
105 $user
106 );
107
108 if (null === $entries) {
109 throw $this->createNotFoundException('No entries found?');
110 }
111
112 try {
113 $entries->setCurrentPage($page);
114 } catch (OutOfRangeCurrentPageException $e) {
115 if ($page > 1) {
116 return $this->redirect($url.'?page='.$entries->getNbPages(), 302);
117 }
118 }
119
120 return $this->render(
121 '@WallabagCore/themes/common/Entry/entries.xml.twig',
122 [
123 'url_html' => $this->generateUrl('tag_entries', ['slug' => $tag->getSlug()], UrlGeneratorInterface::ABSOLUTE_URL),
124 'type' => 'tag ('.$tag->getLabel().')',
125 'url' => $url,
126 'entries' => $entries,
127 ],
128 new Response('', 200, ['Content-Type' => 'application/rss+xml'])
129 );
130 }
131
132 /**
58 * Global method to retrieve entries depending on the given type 133 * Global method to retrieve entries depending on the given type
59 * It returns the response to be send. 134 * It returns the response to be send.
60 * 135 *
@@ -66,7 +141,7 @@ class RssController extends Controller
66 */ 141 */
67 private function showEntries($type, User $user, $page = 1) 142 private function showEntries($type, User $user, $page = 1)
68 { 143 {
69 $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); 144 $repository = $this->get('wallabag_core.entry_repository');
70 145
71 switch ($type) { 146 switch ($type) {
72 case 'starred': 147 case 'starred':
@@ -81,6 +156,10 @@ class RssController extends Controller
81 $qb = $repository->getBuilderForUnreadByUser($user->getId()); 156 $qb = $repository->getBuilderForUnreadByUser($user->getId());
82 break; 157 break;
83 158
159 case 'all':
160 $qb = $repository->getBuilderForAllByUser($user->getId());
161 break;
162
84 default: 163 default:
85 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); 164 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
86 } 165 }
@@ -108,10 +187,15 @@ class RssController extends Controller
108 } 187 }
109 } 188 }
110 189
111 return $this->render('@WallabagCore/themes/common/Entry/entries.xml.twig', [ 190 return $this->render(
112 'type' => $type, 191 '@WallabagCore/themes/common/Entry/entries.xml.twig',
113 'url' => $url, 192 [
114 'entries' => $entries, 193 'url_html' => $this->generateUrl($type, [], UrlGeneratorInterface::ABSOLUTE_URL),
115 ]); 194 'type' => $type,
195 'url' => $url,
196 'entries' => $entries,
197 ],
198 new Response('', 200, ['Content-Type' => 'application/rss+xml'])
199 );
116 } 200 }
117} 201}
diff --git a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
new file mode 100644
index 00000000..98781dab
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
@@ -0,0 +1,174 @@
1<?php
2
3namespace Wallabag\CoreBundle\Controller;
4
5use Symfony\Component\HttpFoundation\Request;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
8use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
9use Wallabag\UserBundle\Entity\User;
10use Wallabag\CoreBundle\Entity\SiteCredential;
11
12/**
13 * SiteCredential controller.
14 *
15 * @Route("/site-credentials")
16 */
17class SiteCredentialController extends Controller
18{
19 /**
20 * Lists all User entities.
21 *
22 * @Route("/", name="site_credentials_index")
23 * @Method("GET")
24 */
25 public function indexAction()
26 {
27 $credentials = $this->get('wallabag_core.site_credential_repository')->findByUser($this->getUser());
28
29 return $this->render('WallabagCoreBundle:SiteCredential:index.html.twig', [
30 'credentials' => $credentials,
31 ]);
32 }
33
34 /**
35 * Creates a new site credential entity.
36 *
37 * @Route("/new", name="site_credentials_new")
38 * @Method({"GET", "POST"})
39 *
40 * @param Request $request
41 *
42 * @return \Symfony\Component\HttpFoundation\Response
43 */
44 public function newAction(Request $request)
45 {
46 $credential = new SiteCredential($this->getUser());
47
48 $form = $this->createForm('Wallabag\CoreBundle\Form\Type\SiteCredentialType', $credential);
49 $form->handleRequest($request);
50
51 if ($form->isSubmitted() && $form->isValid()) {
52 $credential->setUsername($this->get('wallabag_core.helper.crypto_proxy')->crypt($credential->getUsername()));
53 $credential->setPassword($this->get('wallabag_core.helper.crypto_proxy')->crypt($credential->getPassword()));
54
55 $em = $this->getDoctrine()->getManager();
56 $em->persist($credential);
57 $em->flush();
58
59 $this->get('session')->getFlashBag()->add(
60 'notice',
61 $this->get('translator')->trans('flashes.site_credential.notice.added', ['%host%' => $credential->getHost()])
62 );
63
64 return $this->redirectToRoute('site_credentials_index');
65 }
66
67 return $this->render('WallabagCoreBundle:SiteCredential:new.html.twig', [
68 'credential' => $credential,
69 'form' => $form->createView(),
70 ]);
71 }
72
73 /**
74 * Displays a form to edit an existing site credential entity.
75 *
76 * @Route("/{id}/edit", name="site_credentials_edit")
77 * @Method({"GET", "POST"})
78 *
79 * @param Request $request
80 * @param SiteCredential $siteCredential
81 *
82 * @return \Symfony\Component\HttpFoundation\Response
83 */
84 public function editAction(Request $request, SiteCredential $siteCredential)
85 {
86 $this->checkUserAction($siteCredential);
87
88 $deleteForm = $this->createDeleteForm($siteCredential);
89 $editForm = $this->createForm('Wallabag\CoreBundle\Form\Type\SiteCredentialType', $siteCredential);
90 $editForm->handleRequest($request);
91
92 if ($editForm->isSubmitted() && $editForm->isValid()) {
93 $siteCredential->setUsername($this->get('wallabag_core.helper.crypto_proxy')->crypt($siteCredential->getUsername()));
94 $siteCredential->setPassword($this->get('wallabag_core.helper.crypto_proxy')->crypt($siteCredential->getPassword()));
95
96 $em = $this->getDoctrine()->getManager();
97 $em->persist($siteCredential);
98 $em->flush();
99
100 $this->get('session')->getFlashBag()->add(
101 'notice',
102 $this->get('translator')->trans('flashes.site_credential.notice.updated', ['%host%' => $siteCredential->getHost()])
103 );
104
105 return $this->redirectToRoute('site_credentials_index');
106 }
107
108 return $this->render('WallabagCoreBundle:SiteCredential:edit.html.twig', [
109 'credential' => $siteCredential,
110 'edit_form' => $editForm->createView(),
111 'delete_form' => $deleteForm->createView(),
112 ]);
113 }
114
115 /**
116 * Deletes a site credential entity.
117 *
118 * @Route("/{id}", name="site_credentials_delete")
119 * @Method("DELETE")
120 *
121 * @param Request $request
122 * @param SiteCredential $siteCredential
123 *
124 * @return \Symfony\Component\HttpFoundation\RedirectResponse
125 */
126 public function deleteAction(Request $request, SiteCredential $siteCredential)
127 {
128 $this->checkUserAction($siteCredential);
129
130 $form = $this->createDeleteForm($siteCredential);
131 $form->handleRequest($request);
132
133 if ($form->isSubmitted() && $form->isValid()) {
134 $this->get('session')->getFlashBag()->add(
135 'notice',
136 $this->get('translator')->trans('flashes.site_credential.notice.deleted', ['%host%' => $siteCredential->getHost()])
137 );
138
139 $em = $this->getDoctrine()->getManager();
140 $em->remove($siteCredential);
141 $em->flush();
142 }
143
144 return $this->redirectToRoute('site_credentials_index');
145 }
146
147 /**
148 * Creates a form to delete a site credential entity.
149 *
150 * @param SiteCredential $siteCredential The site credential entity
151 *
152 * @return \Symfony\Component\Form\Form The form
153 */
154 private function createDeleteForm(SiteCredential $siteCredential)
155 {
156 return $this->createFormBuilder()
157 ->setAction($this->generateUrl('site_credentials_delete', ['id' => $siteCredential->getId()]))
158 ->setMethod('DELETE')
159 ->getForm()
160 ;
161 }
162
163 /**
164 * Check if the logged user can manage the given site credential.
165 *
166 * @param SiteCredential $siteCredential The site credential entity
167 */
168 private function checkUserAction(SiteCredential $siteCredential)
169 {
170 if (null === $this->getUser() || $this->getUser()->getId() != $siteCredential->getUser()->getId()) {
171 throw $this->createAccessDeniedException('You can not access this site credential.');
172 }
173 }
174}
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php
index 9422bae4..a8b1eadd 100644
--- a/src/Wallabag/CoreBundle/Controller/TagController.php
+++ b/src/Wallabag/CoreBundle/Controller/TagController.php
@@ -84,16 +84,17 @@ class TagController extends Controller
84 */ 84 */
85 public function showTagAction() 85 public function showTagAction()
86 { 86 {
87 $tags = $this->getDoctrine() 87 $repository = $this->get('wallabag_core.entry_repository');
88 ->getRepository('WallabagCoreBundle:Tag') 88 $tags = $this->get('wallabag_core.tag_repository')
89 ->findAllTags($this->getUser()->getId()); 89 ->findAllTags($this->getUser()->getId());
90 90
91 $flatTags = []; 91 $flatTags = [];
92 92
93 foreach ($tags as $tag) { 93 foreach ($tags as $tag) {
94 $nbEntries = $this->getDoctrine() 94 $nbEntries = $repository->countAllEntriesByUserIdAndTagId(
95 ->getRepository('WallabagCoreBundle:Entry') 95 $this->getUser()->getId(),
96 ->countAllEntriesByUserIdAndTagId($this->getUser()->getId(), $tag->getId()); 96 $tag->getId()
97 );
97 98
98 $flatTags[] = [ 99 $flatTags[] = [
99 'id' => $tag->getId(), 100 'id' => $tag->getId(),
@@ -119,9 +120,10 @@ class TagController extends Controller
119 */ 120 */
120 public function showEntriesForTagAction(Tag $tag, $page, Request $request) 121 public function showEntriesForTagAction(Tag $tag, $page, Request $request)
121 { 122 {
122 $entriesByTag = $this->getDoctrine() 123 $entriesByTag = $this->get('wallabag_core.entry_repository')->findAllByTagId(
123 ->getRepository('WallabagCoreBundle:Entry') 124 $this->getUser()->getId(),
124 ->findAllByTagId($this->getUser()->getId(), $tag->getId()); 125 $tag->getId()
126 );
125 127
126 $pagerAdapter = new ArrayAdapter($entriesByTag); 128 $pagerAdapter = new ArrayAdapter($entriesByTag);
127 129
@@ -142,7 +144,7 @@ class TagController extends Controller
142 'form' => null, 144 'form' => null,
143 'entries' => $entries, 145 'entries' => $entries,
144 'currentPage' => $page, 146 'currentPage' => $page,
145 'tag' => $tag->getSlug(), 147 'tag' => $tag,
146 ]); 148 ]);
147 } 149 }
148} 150}
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php
new file mode 100644
index 00000000..866f55a4
--- /dev/null
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php
@@ -0,0 +1,34 @@
1<?php
2
3namespace Wallabag\CoreBundle\DataFixtures\ORM;
4
5use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\SiteCredential;
9
10class LoadSiteCredentialData extends AbstractFixture implements OrderedFixtureInterface
11{
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $credential = new SiteCredential($this->getReference('admin-user'));
18 $credential->setHost('example.com');
19 $credential->setUsername('foo');
20 $credential->setPassword('bar');
21
22 $manager->persist($credential);
23
24 $manager->flush();
25 }
26
27 /**
28 * {@inheritdoc}
29 */
30 public function getOrder()
31 {
32 return 50;
33 }
34}
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
index 33df92d3..a9791f6b 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
@@ -63,6 +63,8 @@ class Configuration implements ConfigurationInterface
63 ->end() 63 ->end()
64 ->end() 64 ->end()
65 ->end() 65 ->end()
66 ->scalarNode('encryption_key_path')
67 ->end()
66 ->end() 68 ->end()
67 ; 69 ;
68 70
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index b4d8a386..532ce238 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -29,6 +29,7 @@ class WallabagCoreExtension extends Extension
29 $container->setParameter('wallabag_core.fetching_error_message_title', $config['fetching_error_message_title']); 29 $container->setParameter('wallabag_core.fetching_error_message_title', $config['fetching_error_message_title']);
30 $container->setParameter('wallabag_core.api_limit_mass_actions', $config['api_limit_mass_actions']); 30 $container->setParameter('wallabag_core.api_limit_mass_actions', $config['api_limit_mass_actions']);
31 $container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']); 31 $container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']);
32 $container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']);
32 33
33 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 34 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
34 $loader->load('services.yml'); 35 $loader->load('services.yml');
diff --git a/src/Wallabag/CoreBundle/Entity/SiteCredential.php b/src/Wallabag/CoreBundle/Entity/SiteCredential.php
new file mode 100644
index 00000000..58075e92
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Entity/SiteCredential.php
@@ -0,0 +1,195 @@
1<?php
2
3namespace Wallabag\CoreBundle\Entity;
4
5use Doctrine\ORM\Mapping as ORM;
6use Symfony\Component\Validator\Constraints as Assert;
7use Wallabag\UserBundle\Entity\User;
8
9/**
10 * SiteCredential.
11 *
12 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\SiteCredentialRepository")
13 * @ORM\Table(name="`site_credential`")
14 * @ORM\HasLifecycleCallbacks()
15 */
16class SiteCredential
17{
18 /**
19 * @var int
20 *
21 * @ORM\Column(name="id", type="integer")
22 * @ORM\Id
23 * @ORM\GeneratedValue(strategy="AUTO")
24 */
25 private $id;
26
27 /**
28 * @var string
29 *
30 * @Assert\NotBlank()
31 * @Assert\Length(max=255)
32 * @ORM\Column(name="host", type="string", length=255)
33 */
34 private $host;
35
36 /**
37 * @var string
38 *
39 * @Assert\NotBlank()
40 * @ORM\Column(name="username", type="text")
41 */
42 private $username;
43
44 /**
45 * @var string
46 *
47 * @Assert\NotBlank()
48 * @ORM\Column(name="password", type="text")
49 */
50 private $password;
51
52 /**
53 * @var \DateTime
54 *
55 * @ORM\Column(name="createdAt", type="datetime")
56 */
57 private $createdAt;
58
59 /**
60 * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="site_credentials")
61 */
62 private $user;
63
64 /*
65 * @param User $user
66 */
67 public function __construct(User $user)
68 {
69 $this->user = $user;
70 }
71
72 /**
73 * Get id.
74 *
75 * @return int
76 */
77 public function getId()
78 {
79 return $this->id;
80 }
81
82 /**
83 * Set host.
84 *
85 * @param string $host
86 *
87 * @return SiteCredential
88 */
89 public function setHost($host)
90 {
91 $this->host = $host;
92
93 return $this;
94 }
95
96 /**
97 * Get host.
98 *
99 * @return string
100 */
101 public function getHost()
102 {
103 return $this->host;
104 }
105
106 /**
107 * Set username.
108 *
109 * @param string $username
110 *
111 * @return SiteCredential
112 */
113 public function setUsername($username)
114 {
115 $this->username = $username;
116
117 return $this;
118 }
119
120 /**
121 * Get username.
122 *
123 * @return string
124 */
125 public function getUsername()
126 {
127 return $this->username;
128 }
129
130 /**
131 * Set password.
132 *
133 * @param string $password
134 *
135 * @return SiteCredential
136 */
137 public function setPassword($password)
138 {
139 $this->password = $password;
140
141 return $this;
142 }
143
144 /**
145 * Get password.
146 *
147 * @return string
148 */
149 public function getPassword()
150 {
151 return $this->password;
152 }
153
154 /**
155 * Set createdAt.
156 *
157 * @param \DateTime $createdAt
158 *
159 * @return SiteCredential
160 */
161 public function setCreatedAt($createdAt)
162 {
163 $this->createdAt = $createdAt;
164
165 return $this;
166 }
167
168 /**
169 * Get createdAt.
170 *
171 * @return \DateTime
172 */
173 public function getCreatedAt()
174 {
175 return $this->createdAt;
176 }
177
178 /**
179 * @return User
180 */
181 public function getUser()
182 {
183 return $this->user;
184 }
185
186 /**
187 * @ORM\PrePersist
188 */
189 public function timestamps()
190 {
191 if (is_null($this->createdAt)) {
192 $this->createdAt = new \DateTime();
193 }
194 }
195}
diff --git a/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php b/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php
new file mode 100644
index 00000000..fd409ad2
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php
@@ -0,0 +1,44 @@
1<?php
2
3namespace Wallabag\CoreBundle\Form\Type;
4
5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\PasswordType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\Extension\Core\Type\TextType;
9use Symfony\Component\Form\FormBuilderInterface;
10use Symfony\Component\OptionsResolver\OptionsResolver;
11
12class SiteCredentialType extends AbstractType
13{
14 public function buildForm(FormBuilderInterface $builder, array $options)
15 {
16 $builder
17 ->add('host', TextType::class, [
18 'label' => 'site_credential.form.host_label',
19 ])
20 ->add('username', TextType::class, [
21 'label' => 'site_credential.form.username_label',
22 'data' => '',
23 ])
24 ->add('password', PasswordType::class, [
25 'label' => 'site_credential.form.password_label',
26 ])
27 ->add('save', SubmitType::class, [
28 'label' => 'config.form.save',
29 ])
30 ;
31 }
32
33 public function configureOptions(OptionsResolver $resolver)
34 {
35 $resolver->setDefaults([
36 'data_class' => 'Wallabag\CoreBundle\Entity\SiteCredential',
37 ]);
38 }
39
40 public function getBlockPrefix()
41 {
42 return 'site_credential';
43 }
44}
diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php
index 1c56fa9f..a79e6ebe 100644
--- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php
+++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php
@@ -6,6 +6,8 @@ use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfig;
6use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfigBuilder; 6use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfigBuilder;
7use Graby\SiteConfig\ConfigBuilder; 7use Graby\SiteConfig\ConfigBuilder;
8use Psr\Log\LoggerInterface; 8use Psr\Log\LoggerInterface;
9use Wallabag\CoreBundle\Repository\SiteCredentialRepository;
10use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
9 11
10class GrabySiteConfigBuilder implements SiteConfigBuilder 12class GrabySiteConfigBuilder implements SiteConfigBuilder
11{ 13{
@@ -13,27 +15,39 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
13 * @var ConfigBuilder 15 * @var ConfigBuilder
14 */ 16 */
15 private $grabyConfigBuilder; 17 private $grabyConfigBuilder;
18
16 /** 19 /**
17 * @var array 20 * @var SiteCredentialRepository
18 */ 21 */
19 private $credentials; 22 private $credentialRepository;
23
20 /** 24 /**
21 * @var LoggerInterface 25 * @var LoggerInterface
22 */ 26 */
23 private $logger; 27 private $logger;
24 28
25 /** 29 /**
30 * @var Wallabag\UserBundle\Entity\User|null
31 */
32 private $currentUser;
33
34 /**
26 * GrabySiteConfigBuilder constructor. 35 * GrabySiteConfigBuilder constructor.
27 * 36 *
28 * @param ConfigBuilder $grabyConfigBuilder 37 * @param ConfigBuilder $grabyConfigBuilder
29 * @param array $credentials 38 * @param TokenStorage $token
30 * @param LoggerInterface $logger 39 * @param SiteCredentialRepository $credentialRepository
40 * @param LoggerInterface $logger
31 */ 41 */
32 public function __construct(ConfigBuilder $grabyConfigBuilder, array $credentials, LoggerInterface $logger) 42 public function __construct(ConfigBuilder $grabyConfigBuilder, TokenStorage $token, SiteCredentialRepository $credentialRepository, LoggerInterface $logger)
33 { 43 {
34 $this->grabyConfigBuilder = $grabyConfigBuilder; 44 $this->grabyConfigBuilder = $grabyConfigBuilder;
35 $this->credentials = $credentials; 45 $this->credentialRepository = $credentialRepository;
36 $this->logger = $logger; 46 $this->logger = $logger;
47
48 if ($token->getToken()) {
49 $this->currentUser = $token->getToken()->getUser();
50 }
37 } 51 }
38 52
39 /** 53 /**
@@ -47,7 +61,12 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
47 $host = substr($host, 4); 61 $host = substr($host, 4);
48 } 62 }
49 63
50 if (empty($this->credentials[$host])) { 64 $credentials = null;
65 if ($this->currentUser) {
66 $credentials = $this->credentialRepository->findOneByHostAndUser($host, $this->currentUser->getId());
67 }
68
69 if (null === $credentials) {
51 $this->logger->debug('Auth: no credentials available for host.', ['host' => $host]); 70 $this->logger->debug('Auth: no credentials available for host.', ['host' => $host]);
52 71
53 return false; 72 return false;
@@ -62,13 +81,14 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
62 'passwordField' => $config->login_password_field ?: null, 81 'passwordField' => $config->login_password_field ?: null,
63 'extraFields' => $this->processExtraFields($config->login_extra_fields), 82 'extraFields' => $this->processExtraFields($config->login_extra_fields),
64 'notLoggedInXpath' => $config->not_logged_in_xpath ?: null, 83 'notLoggedInXpath' => $config->not_logged_in_xpath ?: null,
65 'username' => $this->credentials[$host]['username'], 84 'username' => $credentials['username'],
66 'password' => $this->credentials[$host]['password'], 85 'password' => $credentials['password'],
67 ]; 86 ];
68 87
69 $config = new SiteConfig($parameters); 88 $config = new SiteConfig($parameters);
70 89
71 // do not leak password in log 90 // do not leak usernames and passwords in log
91 $parameters['username'] = '**masked**';
72 $parameters['password'] = '**masked**'; 92 $parameters['password'] = '**masked**';
73 93
74 $this->logger->debug('Auth: add parameters.', ['host' => $host, 'parameters' => $parameters]); 94 $this->logger->debug('Auth: add parameters.', ['host' => $host, 'parameters' => $parameters]);
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index 0c971863..51bb2ca2 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -120,12 +120,12 @@ class ContentProxy
120 120
121 $this->validateAndSetLanguage( 121 $this->validateAndSetLanguage(
122 $entry, 122 $entry,
123 isset($content['language']) ? $content['language'] : '' 123 isset($content['language']) ? $content['language'] : null
124 ); 124 );
125 125
126 $this->validateAndSetPreviewPicture( 126 $this->validateAndSetPreviewPicture(
127 $entry, 127 $entry,
128 isset($content['open_graph']['og_image']) ? $content['open_graph']['og_image'] : '' 128 isset($content['open_graph']['og_image']) ? $content['open_graph']['og_image'] : null
129 ); 129 );
130 130
131 // if content is an image, define it as a preview too 131 // if content is an image, define it as a preview too
diff --git a/src/Wallabag/CoreBundle/Helper/CryptoProxy.php b/src/Wallabag/CoreBundle/Helper/CryptoProxy.php
new file mode 100644
index 00000000..e8b19cb9
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Helper/CryptoProxy.php
@@ -0,0 +1,86 @@
1<?php
2
3namespace Wallabag\CoreBundle\Helper;
4
5use Psr\Log\LoggerInterface;
6use Defuse\Crypto\Key;
7use Defuse\Crypto\Crypto;
8use Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException;
9
10/**
11 * This is a proxy to crypt and decrypt password used by SiteCredential entity.
12 * BTW, It might be re-use for sth else.
13 */
14class CryptoProxy
15{
16 private $logger;
17 private $encryptionKey;
18
19 public function __construct($encryptionKeyPath, LoggerInterface $logger)
20 {
21 $this->logger = $logger;
22
23 if (!file_exists($encryptionKeyPath)) {
24 $key = Key::createNewRandomKey();
25
26 file_put_contents($encryptionKeyPath, $key->saveToAsciiSafeString());
27 chmod($encryptionKeyPath, 0600);
28 }
29
30 $this->encryptionKey = file_get_contents($encryptionKeyPath);
31 }
32
33 /**
34 * Ensure the given value will be crypted.
35 *
36 * @param string $secretValue Secret valye to crypt
37 *
38 * @return string
39 */
40 public function crypt($secretValue)
41 {
42 $this->logger->debug('Crypto: crypting value: '.$this->mask($secretValue));
43
44 return Crypto::encrypt($secretValue, $this->loadKey());
45 }
46
47 /**
48 * Ensure the given crypted value will be decrypted.
49 *
50 * @param string $cryptedValue The value to be decrypted
51 *
52 * @return string
53 */
54 public function decrypt($cryptedValue)
55 {
56 $this->logger->debug('Crypto: decrypting value: '.$this->mask($cryptedValue));
57
58 try {
59 return Crypto::decrypt($cryptedValue, $this->loadKey());
60 } catch (WrongKeyOrModifiedCiphertextException $e) {
61 throw new \RuntimeException('Decrypt fail: '.$e->getMessage());
62 }
63 }
64
65 /**
66 * Load the private key.
67 *
68 * @return Key
69 */
70 private function loadKey()
71 {
72 return Key::loadFromAsciiSafeString($this->encryptionKey);
73 }
74
75 /**
76 * Keep first and last character and put some stars in between.
77 *
78 * @param string $value Value to mask
79 *
80 * @return string
81 */
82 private function mask($value)
83 {
84 return strlen($value) > 0 ? $value[0].'*****'.$value[strlen($value) - 1] : 'Empty value';
85 }
86}
diff --git a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php
index df579ebd..231a0b52 100644
--- a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php
+++ b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php
@@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Helper;
4 4
5use Pagerfanta\Adapter\AdapterInterface; 5use Pagerfanta\Adapter\AdapterInterface;
6use Pagerfanta\Pagerfanta; 6use Pagerfanta\Pagerfanta;
7use Wallabag\UserBundle\Entity\User;
7use Symfony\Component\Routing\Router; 8use Symfony\Component\Routing\Router;
8use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; 9use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
9 10
@@ -20,12 +21,15 @@ class PreparePagerForEntries
20 21
21 /** 22 /**
22 * @param AdapterInterface $adapter 23 * @param AdapterInterface $adapter
24 * @param User $user If user isn't logged in, we can force it (like for rss)
23 * 25 *
24 * @return null|Pagerfanta 26 * @return null|Pagerfanta
25 */ 27 */
26 public function prepare(AdapterInterface $adapter) 28 public function prepare(AdapterInterface $adapter, User $user = null)
27 { 29 {
28 $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; 30 if (null === $user) {
31 $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
32 }
29 33
30 if (null === $user || !is_object($user)) { 34 if (null === $user || !is_object($user)) {
31 return; 35 return;
diff --git a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php
new file mode 100644
index 00000000..36906761
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php
@@ -0,0 +1,47 @@
1<?php
2
3namespace Wallabag\CoreBundle\Repository;
4
5use Wallabag\CoreBundle\Helper\CryptoProxy;
6
7/**
8 * SiteCredentialRepository.
9 */
10class SiteCredentialRepository extends \Doctrine\ORM\EntityRepository
11{
12 private $cryptoProxy;
13
14 public function setCrypto(CryptoProxy $cryptoProxy)
15 {
16 $this->cryptoProxy = $cryptoProxy;
17 }
18
19 /**
20 * Retrieve one username/password for the given host and userId.
21 *
22 * @param string $host
23 * @param int $userId
24 *
25 * @return null|array
26 */
27 public function findOneByHostAndUser($host, $userId)
28 {
29 $res = $this->createQueryBuilder('s')
30 ->select('s.username', 's.password')
31 ->where('s.host = :hostname')->setParameter('hostname', $host)
32 ->andWhere('s.user = :userId')->setParameter('userId', $userId)
33 ->setMaxResults(1)
34 ->getQuery()
35 ->getOneOrNullResult();
36
37 if (null === $res) {
38 return;
39 }
40
41 // decrypt user & password before returning them
42 $res['username'] = $this->cryptoProxy->decrypt($res['username']);
43 $res['password'] = $this->cryptoProxy->decrypt($res['password']);
44
45 return $res;
46 }
47}
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 4be79547..e09b0f18 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -63,7 +63,8 @@ services:
63 class: Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder 63 class: Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder
64 arguments: 64 arguments:
65 - "@wallabag_core.graby.config_builder" 65 - "@wallabag_core.graby.config_builder"
66 - "%sites_credentials%" 66 - "@security.token_storage"
67 - "@wallabag_core.site_credential_repository"
67 - '@logger' 68 - '@logger'
68 tags: 69 tags:
69 - { name: monolog.logger, channel: graby } 70 - { name: monolog.logger, channel: graby }
@@ -120,6 +121,14 @@ services:
120 arguments: 121 arguments:
121 - WallabagCoreBundle:Tag 122 - WallabagCoreBundle:Tag
122 123
124 wallabag_core.site_credential_repository:
125 class: Wallabag\CoreBundle\Repository\SiteCredentialRepository
126 factory: [ "@doctrine.orm.default_entity_manager", getRepository ]
127 arguments:
128 - WallabagCoreBundle:SiteCredential
129 calls:
130 - [ setCrypto, [ "@wallabag_core.helper.crypto_proxy" ] ]
131
123 wallabag_core.helper.entries_export: 132 wallabag_core.helper.entries_export:
124 class: Wallabag\CoreBundle\Helper\EntriesExport 133 class: Wallabag\CoreBundle\Helper\EntriesExport
125 arguments: 134 arguments:
@@ -201,3 +210,9 @@ services:
201 210
202 wallabag_core.entry.download_images.client: 211 wallabag_core.entry.download_images.client:
203 class: GuzzleHttp\Client 212 class: GuzzleHttp\Client
213
214 wallabag_core.helper.crypto_proxy:
215 class: Wallabag\CoreBundle\Helper\CryptoProxy
216 arguments:
217 - "%wallabag_core.site_credentials.encryption_key_path%"
218 - "@logger"
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index 02dd04f2..52904d25 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -32,6 +32,7 @@ menu:
32 # save_link: 'Save a link' 32 # save_link: 'Save a link'
33 back_to_unread: 'Tilbage til de ulæste artikler' 33 back_to_unread: 'Tilbage til de ulæste artikler'
34 # users_management: 'Users management' 34 # users_management: 'Users management'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Tilføj ny artikel' 37 add_new_entry: 'Tilføj ny artikel'
37 search: 'Søg' 38 search: 'Søg'
@@ -89,9 +90,10 @@ config:
89 token_reset: 'Nulstil token' 90 token_reset: 'Nulstil token'
90 rss_links: 'RSS-Links' 91 rss_links: 'RSS-Links'
91 rss_link: 92 rss_link:
92 unread: 'ulæst' 93 unread: 'Ulæst'
93 starred: 'favoritter' 94 starred: 'Favoritter'
94 archive: 'arkiv' 95 archive: 'Arkiv'
96 # all: 'All'
95 # rss_limit: 'Number of items in the feed' 97 # rss_limit: 'Number of items in the feed'
96 form_user: 98 form_user:
97 # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion" 99 # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion"
@@ -520,6 +522,26 @@ user:
520 search: 522 search:
521 # placeholder: Filter by username or email 523 # placeholder: Filter by username or email
522 524
525site_credential:
526 # page_title: Site credentials management
527 # new_site_credential: Create a credential
528 # edit_site_credential: Edit an existing credential
529 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
530 # list:
531 # actions: Actions
532 # edit_action: Edit
533 # yes: Yes
534 # no: No
535 # create_new_one: Create a new credential
536 # form:
537 # username_label: 'Username'
538 # host_label: 'Host'
539 # password_label: 'Password'
540 # save: Save
541 # delete: Delete
542 # delete_confirm: Are you sure?
543 # back_to_list: Back to list
544
523error: 545error:
524 # page_title: An error occurred 546 # page_title: An error occurred
525 547
@@ -572,3 +594,8 @@ flashes:
572 # added: 'User "%username%" added' 594 # added: 'User "%username%" added'
573 # updated: 'User "%username%" updated' 595 # updated: 'User "%username%" updated'
574 # deleted: 'User "%username%" deleted' 596 # deleted: 'User "%username%" deleted'
597 site_credential:
598 notice:
599 # added: 'Site credential for "%host%" added'
600 # updated: 'Site credential for "%host%" updated'
601 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index f6ccdae0..481b5d05 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -32,6 +32,7 @@ menu:
32 save_link: 'Link speichern' 32 save_link: 'Link speichern'
33 back_to_unread: 'Zurück zu ungelesenen Artikeln' 33 back_to_unread: 'Zurück zu ungelesenen Artikeln'
34 users_management: 'Benutzerverwaltung' 34 users_management: 'Benutzerverwaltung'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Neuen Artikel hinzufügen' 37 add_new_entry: 'Neuen Artikel hinzufügen'
37 search: 'Suche' 38 search: 'Suche'
@@ -92,6 +93,7 @@ config:
92 unread: 'Ungelesene' 93 unread: 'Ungelesene'
93 starred: 'Favoriten' 94 starred: 'Favoriten'
94 archive: 'Archivierte' 95 archive: 'Archivierte'
96 # all: 'All'
95 rss_limit: 'Anzahl der Einträge pro Feed' 97 rss_limit: 'Anzahl der Einträge pro Feed'
96 form_user: 98 form_user:
97 two_factor_description: "Wenn du die Zwei-Faktor-Authentifizierung aktivierst, erhältst du eine E-Mail mit einem Code bei jeder nicht vertrauenswürdigen Verbindung" 99 two_factor_description: "Wenn du die Zwei-Faktor-Authentifizierung aktivierst, erhältst du eine E-Mail mit einem Code bei jeder nicht vertrauenswürdigen Verbindung"
@@ -521,6 +523,26 @@ user:
521 search: 523 search:
522 placeholder: Filtere nach Benutzer oder E-Mail-Adresse 524 placeholder: Filtere nach Benutzer oder E-Mail-Adresse
523 525
526site_credential:
527 # page_title: Site credentials management
528 # new_site_credential: Create a credential
529 # edit_site_credential: Edit an existing credential
530 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
531 list:
532 actions: Aktionen
533 edit_action: Bearbeiten
534 yes: Ja
535 no: Nein
536 # create_new_one: Create a new credential
537 form:
538 # username_label: 'Username'
539 # host_label: 'Host'
540 # password_label: 'Password'
541 save: Speichern
542 delete: Löschen
543 delete_confirm: Bist du sicher?
544 back_to_list: Zurück zur Liste
545
524error: 546error:
525 page_title: Ein Fehler ist aufgetreten 547 page_title: Ein Fehler ist aufgetreten
526 548
@@ -573,3 +595,8 @@ flashes:
573 added: 'Benutzer "%username%" hinzugefügt' 595 added: 'Benutzer "%username%" hinzugefügt'
574 updated: 'Benutzer "%username%" aktualisiert' 596 updated: 'Benutzer "%username%" aktualisiert'
575 deleted: 'Benutzer "%username%" gelöscht' 597 deleted: 'Benutzer "%username%" gelöscht'
598 site_credential:
599 notice:
600 # added: 'Site credential for "%host%" added'
601 # updated: 'Site credential for "%host%" updated'
602 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index 902c3046..98888d05 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -32,6 +32,7 @@ menu:
32 save_link: 'Save a link' 32 save_link: 'Save a link'
33 back_to_unread: 'Back to unread articles' 33 back_to_unread: 'Back to unread articles'
34 users_management: 'Users management' 34 users_management: 'Users management'
35 site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Add a new entry' 37 add_new_entry: 'Add a new entry'
37 search: 'Search' 38 search: 'Search'
@@ -89,9 +90,10 @@ config:
89 token_reset: 'Regenerate your token' 90 token_reset: 'Regenerate your token'
90 rss_links: 'RSS links' 91 rss_links: 'RSS links'
91 rss_link: 92 rss_link:
92 unread: 'unread' 93 unread: 'Unread'
93 starred: 'starred' 94 starred: 'Starred'
94 archive: 'archived' 95 archive: 'Archived'
96 all: 'All'
95 rss_limit: 'Number of items in the feed' 97 rss_limit: 'Number of items in the feed'
96 form_user: 98 form_user:
97 two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connection." 99 two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connection."
@@ -521,6 +523,26 @@ user:
521 search: 523 search:
522 placeholder: Filter by username or email 524 placeholder: Filter by username or email
523 525
526site_credential:
527 page_title: Site credentials management
528 new_site_credential: Create a credential
529 edit_site_credential: Edit an existing credential
530 description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
531 list:
532 actions: Actions
533 edit_action: Edit
534 yes: Yes
535 no: No
536 create_new_one: Create a new credential
537 form:
538 username_label: 'Username'
539 host_label: 'Host'
540 password_label: 'Password'
541 save: Save
542 delete: Delete
543 delete_confirm: Are you sure?
544 back_to_list: Back to list
545
524error: 546error:
525 page_title: An error occurred 547 page_title: An error occurred
526 548
@@ -573,3 +595,8 @@ flashes:
573 added: 'User "%username%" added' 595 added: 'User "%username%" added'
574 updated: 'User "%username%" updated' 596 updated: 'User "%username%" updated'
575 deleted: 'User "%username%" deleted' 597 deleted: 'User "%username%" deleted'
598 site_credential:
599 notice:
600 added: 'Site credential for "%host%" added'
601 updated: 'Site credential for "%host%" updated'
602 deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index afd6a7b1..310a00de 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -32,6 +32,7 @@ menu:
32 save_link: 'Guardar un enlace' 32 save_link: 'Guardar un enlace'
33 back_to_unread: 'Volver a los artículos sin leer' 33 back_to_unread: 'Volver a los artículos sin leer'
34 users_management: 'Configuración de usuarios' 34 users_management: 'Configuración de usuarios'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Añadir un nuevo artículo' 37 add_new_entry: 'Añadir un nuevo artículo'
37 search: 'Buscar' 38 search: 'Buscar'
@@ -92,6 +93,7 @@ config:
92 unread: 'sin leer' 93 unread: 'sin leer'
93 starred: 'favoritos' 94 starred: 'favoritos'
94 archive: 'archivados' 95 archive: 'archivados'
96 # all: 'All'
95 rss_limit: 'Límite de artículos en feed RSS' 97 rss_limit: 'Límite de artículos en feed RSS'
96 form_user: 98 form_user:
97 two_factor_description: "Con la autenticación en dos pasos recibirá código por e-mail en cada nueva conexión que no sea de confianza." 99 two_factor_description: "Con la autenticación en dos pasos recibirá código por e-mail en cada nueva conexión que no sea de confianza."
@@ -521,6 +523,26 @@ user:
521 search: 523 search:
522 # placeholder: Filter by username or email 524 # placeholder: Filter by username or email
523 525
526site_credential:
527 # page_title: Site credentials management
528 # new_site_credential: Create a credential
529 # edit_site_credential: Edit an existing credential
530 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
531 # list:
532 # actions: Actions
533 # edit_action: Edit
534 # yes: Yes
535 # no: No
536 # create_new_one: Create a new credential
537 # form:
538 # username_label: 'Username'
539 # host_label: 'Host'
540 # password_label: 'Password'
541 # save: Save
542 # delete: Delete
543 # delete_confirm: Are you sure?
544 # back_to_list: Back to list
545
524error: 546error:
525 page_title: Ha ocurrido un error 547 page_title: Ha ocurrido un error
526 548
@@ -573,3 +595,8 @@ flashes:
573 added: 'Añadido el usuario "%username%"' 595 added: 'Añadido el usuario "%username%"'
574 updated: 'Actualizado el usuario "%username%"' 596 updated: 'Actualizado el usuario "%username%"'
575 deleted: 'Eliminado el usuario "%username%"' 597 deleted: 'Eliminado el usuario "%username%"'
598 site_credential:
599 notice:
600 # added: 'Site credential for "%host%" added'
601 # updated: 'Site credential for "%host%" updated'
602 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index 545514b3..d5247fc3 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -32,6 +32,7 @@ menu:
32 save_link: 'ذخیرهٔ یک پیوند' 32 save_link: 'ذخیرهٔ یک پیوند'
33 back_to_unread: 'بازگشت به خوانده‌نشده‌ها' 33 back_to_unread: 'بازگشت به خوانده‌نشده‌ها'
34 # users_management: 'Users management' 34 # users_management: 'Users management'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'افزودن مقالهٔ تازه' 37 add_new_entry: 'افزودن مقالهٔ تازه'
37 search: 'جستجو' 38 search: 'جستجو'
@@ -92,6 +93,7 @@ config:
92 unread: 'خوانده‌نشده' 93 unread: 'خوانده‌نشده'
93 starred: 'برگزیده' 94 starred: 'برگزیده'
94 archive: 'بایگانی' 95 archive: 'بایگانی'
96 # all: 'All'
95 rss_limit: 'محدودیت آر-اس-اس' 97 rss_limit: 'محدودیت آر-اس-اس'
96 form_user: 98 form_user:
97 two_factor_description: "با فعال‌کردن تأیید ۲مرحله‌ای هر بار که اتصال تأییدنشده‌ای برقرار شد، به شما یک کد از راه ایمیل فرستاده می‌شود" 99 two_factor_description: "با فعال‌کردن تأیید ۲مرحله‌ای هر بار که اتصال تأییدنشده‌ای برقرار شد، به شما یک کد از راه ایمیل فرستاده می‌شود"
@@ -521,6 +523,26 @@ user:
521 search: 523 search:
522 # placeholder: Filter by username or email 524 # placeholder: Filter by username or email
523 525
526site_credential:
527 # page_title: Site credentials management
528 # new_site_credential: Create a credential
529 # edit_site_credential: Edit an existing credential
530 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
531 # list:
532 # actions: Actions
533 # edit_action: Edit
534 # yes: Yes
535 # no: No
536 # create_new_one: Create a new credential
537 # form:
538 # username_label: 'Username'
539 # host_label: 'Host'
540 # password_label: 'Password'
541 # save: Save
542 # delete: Delete
543 # delete_confirm: Are you sure?
544 # back_to_list: Back to list
545
524error: 546error:
525 # page_title: An error occurred 547 # page_title: An error occurred
526 548
@@ -573,3 +595,8 @@ flashes:
573 # added: 'User "%username%" added' 595 # added: 'User "%username%" added'
574 # updated: 'User "%username%" updated' 596 # updated: 'User "%username%" updated'
575 # deleted: 'User "%username%" deleted' 597 # deleted: 'User "%username%" deleted'
598 site_credential:
599 notice:
600 # added: 'Site credential for "%host%" added'
601 # updated: 'Site credential for "%host%" updated'
602 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index e9e79c67..b338eba4 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -32,6 +32,7 @@ menu:
32 save_link: "Sauvegarder un nouvel article" 32 save_link: "Sauvegarder un nouvel article"
33 back_to_unread: "Retour aux articles non lus" 33 back_to_unread: "Retour aux articles non lus"
34 users_management: "Gestion des utilisateurs" 34 users_management: "Gestion des utilisateurs"
35 site_credentials: 'Accès aux sites'
35 top: 36 top:
36 add_new_entry: "Sauvegarder un nouvel article" 37 add_new_entry: "Sauvegarder un nouvel article"
37 search: "Rechercher" 38 search: "Rechercher"
@@ -87,11 +88,12 @@ config:
87 no_token: "Aucun jeton généré" 88 no_token: "Aucun jeton généré"
88 token_create: "Créez votre jeton" 89 token_create: "Créez votre jeton"
89 token_reset: "Réinitialisez votre jeton" 90 token_reset: "Réinitialisez votre jeton"
90 rss_links: "Adresse de vos flux RSS" 91 rss_links: "Adresses de vos flux RSS"
91 rss_link: 92 rss_link:
92 unread: "non lus" 93 unread: "Non lus"
93 starred: "favoris" 94 starred: "Favoris"
94 archive: "lus" 95 archive: "Lus"
96 all: "Tous"
95 rss_limit: "Nombre d’articles dans le flux" 97 rss_limit: "Nombre d’articles dans le flux"
96 form_user: 98 form_user:
97 two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel à chaque nouvelle connexion non approuvée." 99 two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel à chaque nouvelle connexion non approuvée."
@@ -516,11 +518,31 @@ user:
516 twofactor_label: "Double authentification" 518 twofactor_label: "Double authentification"
517 save: "Sauvegarder" 519 save: "Sauvegarder"
518 delete: "Supprimer" 520 delete: "Supprimer"
519 delete_confirm: "Voulez-vous vraiment ?" 521 delete_confirm: "Êtes-vous r ?"
520 back_to_list: "Revenir à la liste" 522 back_to_list: "Revenir à la liste"
521 search: 523 search:
522 placeholder: "Filtrer par nom d’utilisateur ou email" 524 placeholder: "Filtrer par nom d’utilisateur ou email"
523 525
526site_credential:
527 page_title: Gestion des accès aux sites
528 new_site_credential: Créer un accès à un site
529 edit_site_credential: Éditer l'accès d'un site
530 description: "Ici vous pouvez gérer les accès aux différents sites. Ces accès permettent de récupérer des contenus sur des sites qui requièrent une authentification ou un paywall"
531 list:
532 actions: Actions
533 edit_action: Éditer
534 yes: Oui
535 no: Non
536 create_new_one: Créer un nouvel accès à un site
537 form:
538 username_label: 'Identifiant'
539 host_label: 'Domaine'
540 password_label: 'Mot de passe'
541 save: "Sauvegarder"
542 delete: "Supprimer"
543 delete_confirm: "Êtes-vous sûr ?"
544 back_to_list: "Revenir à la liste"
545
524error: 546error:
525 page_title: "Une erreur est survenue" 547 page_title: "Une erreur est survenue"
526 548
@@ -570,6 +592,11 @@ flashes:
570 client_deleted: "Client %name% supprimé" 592 client_deleted: "Client %name% supprimé"
571 user: 593 user:
572 notice: 594 notice:
573 added: "Utilisateur \"%username%\" ajouté" 595 added: 'Utilisateur "%username%" ajouté'
574 updated: "Utilisateur \"%username%\" mis à jour" 596 updated: 'Utilisateur "%username%" mis à jour'
575 deleted: "Utilisateur \"%username%\" supprimé" 597 deleted: 'Utilisateur "%username%" supprimé'
598 site_credential:
599 notice:
600 added: 'Accès au site "%host%" ajouté'
601 updated: 'Accès au site "%host%" mis à jour'
602 deleted: 'Accès au site "%host%" supprimé'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
index 0597d3e3..a3ff5495 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -32,6 +32,7 @@ menu:
32 save_link: 'Salva collegamento' 32 save_link: 'Salva collegamento'
33 back_to_unread: 'Torna ai contenuti non letti' 33 back_to_unread: 'Torna ai contenuti non letti'
34 # users_management: 'Users management' 34 # users_management: 'Users management'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Aggiungi un nuovo contenuto' 37 add_new_entry: 'Aggiungi un nuovo contenuto'
37 search: 'Cerca' 38 search: 'Cerca'
@@ -89,9 +90,10 @@ config:
89 token_reset: 'Rigenera il tuo token' 90 token_reset: 'Rigenera il tuo token'
90 rss_links: 'Collegamenti RSS' 91 rss_links: 'Collegamenti RSS'
91 rss_link: 92 rss_link:
92 unread: 'non letti' 93 unread: 'Non letti'
93 starred: 'preferiti' 94 starred: 'Preferiti'
94 archive: 'archiviati' 95 archive: 'Archiviati'
96 # all: 'All'
95 rss_limit: 'Numero di elementi nel feed' 97 rss_limit: 'Numero di elementi nel feed'
96 form_user: 98 form_user:
97 two_factor_description: "Abilitando l'\autenticazione a due fattori riceverai una e-mail con un codice per ogni nuova connesione non verificata" 99 two_factor_description: "Abilitando l'\autenticazione a due fattori riceverai una e-mail con un codice per ogni nuova connesione non verificata"
@@ -521,6 +523,26 @@ user:
521 search: 523 search:
522 # placeholder: Filter by username or email 524 # placeholder: Filter by username or email
523 525
526site_credential:
527 # page_title: Site credentials management
528 # new_site_credential: Create a credential
529 # edit_site_credential: Edit an existing credential
530 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
531 # list:
532 # actions: Actions
533 # edit_action: Edit
534 # yes: Yes
535 # no: No
536 # create_new_one: Create a new credential
537 # form:
538 # username_label: 'Username'
539 # host_label: 'Host'
540 # password_label: 'Password'
541 # save: Save
542 # delete: Delete
543 # delete_confirm: Are you sure?
544 # back_to_list: Back to list
545
524error: 546error:
525 # page_title: An error occurred 547 # page_title: An error occurred
526 548
@@ -573,3 +595,8 @@ flashes:
573 # added: 'User "%username%" added' 595 # added: 'User "%username%" added'
574 # updated: 'User "%username%" updated' 596 # updated: 'User "%username%" updated'
575 # deleted: 'User "%username%" deleted' 597 # deleted: 'User "%username%" deleted'
598 site_credential:
599 notice:
600 # added: 'Site credential for "%host%" added'
601 # updated: 'Site credential for "%host%" updated'
602 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index c172a0f6..a6566a12 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -32,6 +32,7 @@ menu:
32 save_link: 'Enregistrar un novèl article' 32 save_link: 'Enregistrar un novèl article'
33 back_to_unread: 'Tornar als articles pas legits' 33 back_to_unread: 'Tornar als articles pas legits'
34 users_management: 'Gestion dels utilizaires' 34 users_management: 'Gestion dels utilizaires'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Enregistrar un novèl article' 37 add_new_entry: 'Enregistrar un novèl article'
37 search: 'Cercar' 38 search: 'Cercar'
@@ -87,11 +88,12 @@ config:
87 no_token: 'Pas cap de geton generat' 88 no_token: 'Pas cap de geton generat'
88 token_create: 'Creatz vòstre geton' 89 token_create: 'Creatz vòstre geton'
89 token_reset: 'Reïnicializatz vòstre geton' 90 token_reset: 'Reïnicializatz vòstre geton'
90 rss_links: 'URL de vòstres fluxes RSS' 91 rss_links: 'URLs de vòstres fluxes RSS'
91 rss_link: 92 rss_link:
92 unread: 'pas legits' 93 unread: 'Pas legits'
93 starred: 'favorits' 94 starred: 'Favorits'
94 archive: 'legits' 95 archive: 'Legits'
96 # all: 'All'
95 rss_limit: "Nombre d'articles dins un flux RSS" 97 rss_limit: "Nombre d'articles dins un flux RSS"
96 form_user: 98 form_user:
97 two_factor_description: "Activar l'autentificacion doble-factor vòl dire que recebretz un còdi per corrièl per cada novèla connexion pas aprovada." 99 two_factor_description: "Activar l'autentificacion doble-factor vòl dire que recebretz un còdi per corrièl per cada novèla connexion pas aprovada."
@@ -521,6 +523,26 @@ user:
521 search: 523 search:
522 placeholder: "Filtrar per nom d'utilizaire o corrièl" 524 placeholder: "Filtrar per nom d'utilizaire o corrièl"
523 525
526site_credential:
527 # page_title: Site credentials management
528 # new_site_credential: Create a credential
529 # edit_site_credential: Edit an existing credential
530 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
531 list:
532 actions: 'Accions'
533 edit_action: 'Modificar'
534 yes: 'Òc'
535 no: 'Non'
536 # create_new_one: Create a new credential
537 form:
538 # username_label: 'Username'
539 # host_label: 'Host'
540 # password_label: 'Password'
541 save: 'Enregistrar'
542 delete: 'Suprimir'
543 delete_confirm: 'Sètz segur ?'
544 back_to_list: 'Tornar a la lista'
545
524error: 546error:
525 page_title: Una error s'es produsida 547 page_title: Una error s'es produsida
526 548
@@ -573,3 +595,8 @@ flashes:
573 added: 'Utilizaire "%username%" ajustat' 595 added: 'Utilizaire "%username%" ajustat'
574 updated: 'Utilizaire "%username%" mes a jorn' 596 updated: 'Utilizaire "%username%" mes a jorn'
575 deleted: 'Utilizaire "%username%" suprimit' 597 deleted: 'Utilizaire "%username%" suprimit'
598 site_credential:
599 notice:
600 # added: 'Site credential for "%host%" added'
601 # updated: 'Site credential for "%host%" updated'
602 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index 82d16767..8e1276d9 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -32,6 +32,7 @@ menu:
32 save_link: 'Zapisz link' 32 save_link: 'Zapisz link'
33 back_to_unread: 'Powrót do nieprzeczytanych artykułów' 33 back_to_unread: 'Powrót do nieprzeczytanych artykułów'
34 users_management: 'Zarządzanie użytkownikami' 34 users_management: 'Zarządzanie użytkownikami'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Dodaj nowy wpis' 37 add_new_entry: 'Dodaj nowy wpis'
37 search: 'Szukaj' 38 search: 'Szukaj'
@@ -89,9 +90,10 @@ config:
89 token_reset: 'Zresetuj swojego tokena' 90 token_reset: 'Zresetuj swojego tokena'
90 rss_links: 'RSS links' 91 rss_links: 'RSS links'
91 rss_link: 92 rss_link:
92 unread: 'nieprzeczytane' 93 unread: 'Nieprzeczytane'
93 starred: 'oznaczone gwiazdką' 94 starred: 'Oznaczone gwiazdką'
94 archive: 'archiwum' 95 archive: 'Archiwum'
96 # all: 'All'
95 rss_limit: 'Link do RSS' 97 rss_limit: 'Link do RSS'
96 form_user: 98 form_user:
97 two_factor_description: "Włączenie autoryzacji dwuetapowej oznacza, że będziesz otrzymywał maile z kodem przy każdym nowym, niezaufanym połączeniu" 99 two_factor_description: "Włączenie autoryzacji dwuetapowej oznacza, że będziesz otrzymywał maile z kodem przy każdym nowym, niezaufanym połączeniu"
@@ -521,6 +523,26 @@ user:
521 search: 523 search:
522 placeholder: Filtruj po nazwie użytkownika lub adresie e-mail 524 placeholder: Filtruj po nazwie użytkownika lub adresie e-mail
523 525
526site_credential:
527 # page_title: Site credentials management
528 # new_site_credential: Create a credential
529 # edit_site_credential: Edit an existing credential
530 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
531 list:
532 actions: Akcje
533 edit_action: Edytuj
534 yes: Tak
535 no: Nie
536 # create_new_one: Create a new credential
537 form:
538 # username_label: 'Username'
539 # host_label: 'Host'
540 # password_label: 'Password'
541 save: Zapisz
542 delete: Usuń
543 delete_confirm: Jesteś pewien?
544 back_to_list: Powrót do listy
545
524error: 546error:
525 page_title: Wystąpił błąd 547 page_title: Wystąpił błąd
526 548
@@ -573,3 +595,8 @@ flashes:
573 added: 'Użytkownik "%username%" dodany' 595 added: 'Użytkownik "%username%" dodany'
574 updated: 'Użytkownik "%username%" zaktualizowany' 596 updated: 'Użytkownik "%username%" zaktualizowany'
575 deleted: 'Użytkownik "%username%" usunięty' 597 deleted: 'Użytkownik "%username%" usunięty'
598 site_credential:
599 notice:
600 # added: 'Site credential for "%host%" added'
601 # updated: 'Site credential for "%host%" updated'
602 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
index b75567d6..953c86bb 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
@@ -32,6 +32,7 @@ menu:
32 save_link: 'Salvar um link' 32 save_link: 'Salvar um link'
33 back_to_unread: 'Voltar para os artigos não lidos' 33 back_to_unread: 'Voltar para os artigos não lidos'
34 users_management: 'Gestão de Usuários' 34 users_management: 'Gestão de Usuários'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Adicionar uma nova entrada' 37 add_new_entry: 'Adicionar uma nova entrada'
37 search: 'Pesquisa' 38 search: 'Pesquisa'
@@ -89,9 +90,10 @@ config:
89 token_reset: 'Gerar novamente seu token' 90 token_reset: 'Gerar novamente seu token'
90 rss_links: 'Links RSS' 91 rss_links: 'Links RSS'
91 rss_link: 92 rss_link:
92 unread: 'não lido' 93 unread: 'Não lido'
93 starred: 'destacado' 94 starred: 'Destacado'
94 archive: 'arquivado' 95 archive: 'Arquivado'
96 # all: 'All'
95 rss_limit: 'Número de itens no feed' 97 rss_limit: 'Número de itens no feed'
96 form_user: 98 form_user:
97 two_factor_description: 'Habilitar autenticação de dois passos significa que você receberá um e-mail com um código a cada nova conexão desconhecida.' 99 two_factor_description: 'Habilitar autenticação de dois passos significa que você receberá um e-mail com um código a cada nova conexão desconhecida.'
@@ -521,6 +523,26 @@ user:
521 search: 523 search:
522 # placeholder: Filter by username or email 524 # placeholder: Filter by username or email
523 525
526site_credential:
527 # page_title: Site credentials management
528 # new_site_credential: Create a credential
529 # edit_site_credential: Edit an existing credential
530 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
531 list:
532 actions: 'Ações'
533 edit_action: 'Editar'
534 yes: 'Sim'
535 no: 'Não'
536 # create_new_one: Create a new credential
537 form:
538 # username_label: 'Username'
539 # host_label: 'Host'
540 # password_label: 'Password'
541 save: 'Salvar'
542 delete: 'Apagar'
543 delete_confirm: 'Tem certeza?'
544 back_to_list: 'Voltar para a lista'
545
524error: 546error:
525 # page_title: An error occurred 547 # page_title: An error occurred
526 548
@@ -573,3 +595,8 @@ flashes:
573 added: 'Usuário "%username%" adicionado' 595 added: 'Usuário "%username%" adicionado'
574 updated: 'Usuário "%username%" atualizado' 596 updated: 'Usuário "%username%" atualizado'
575 deleted: 'Usuário "%username%" removido' 597 deleted: 'Usuário "%username%" removido'
598 site_credential:
599 notice:
600 # added: 'Site credential for "%host%" added'
601 # updated: 'Site credential for "%host%" updated'
602 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index 95df573d..51dbbcaf 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -32,6 +32,7 @@ menu:
32 # save_link: 'Save a link' 32 # save_link: 'Save a link'
33 back_to_unread: 'Înapoi la articolele necitite' 33 back_to_unread: 'Înapoi la articolele necitite'
34 # users_management: 'Users management' 34 # users_management: 'Users management'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Introdu un nou articol' 37 add_new_entry: 'Introdu un nou articol'
37 search: 'Căutare' 38 search: 'Căutare'
@@ -89,9 +90,10 @@ config:
89 token_reset: 'Resetează-ți token-ul' 90 token_reset: 'Resetează-ți token-ul'
90 rss_links: 'Link-uri RSS' 91 rss_links: 'Link-uri RSS'
91 rss_link: 92 rss_link:
92 unread: 'unread' 93 unread: 'Unread'
93 starred: 'starred' 94 starred: 'Starred'
94 archive: 'archived' 95 archive: 'Archived'
96 # all: 'All'
95 rss_limit: 'Limită RSS' 97 rss_limit: 'Limită RSS'
96 form_user: 98 form_user:
97 # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion" 99 # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion"
@@ -521,6 +523,26 @@ user:
521 search: 523 search:
522 # placeholder: Filter by username or email 524 # placeholder: Filter by username or email
523 525
526site_credential:
527 # page_title: Site credentials management
528 # new_site_credential: Create a credential
529 # edit_site_credential: Edit an existing credential
530 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
531 # list:
532 # actions: Actions
533 # edit_action: Edit
534 # yes: Yes
535 # no: No
536 # create_new_one: Create a new credential
537 # form:
538 # username_label: 'Username'
539 # host_label: 'Host'
540 # password_label: 'Password'
541 # save: Save
542 # delete: Delete
543 # delete_confirm: Are you sure?
544 # back_to_list: Back to list
545
524error: 546error:
525 # page_title: An error occurred 547 # page_title: An error occurred
526 548
@@ -573,3 +595,8 @@ flashes:
573 # added: 'User "%username%" added' 595 # added: 'User "%username%" added'
574 # updated: 'User "%username%" updated' 596 # updated: 'User "%username%" updated'
575 # deleted: 'User "%username%" deleted' 597 # deleted: 'User "%username%" deleted'
598 site_credential:
599 notice:
600 # added: 'Site credential for "%host%" added'
601 # updated: 'Site credential for "%host%" updated'
602 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index 61e1a1ea..ff19e9d9 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -32,6 +32,7 @@ menu:
32 # save_link: 'Save a link' 32 # save_link: 'Save a link'
33 back_to_unread: 'Okunmayan makalelere geri dön' 33 back_to_unread: 'Okunmayan makalelere geri dön'
34 # users_management: 'Users management' 34 # users_management: 'Users management'
35 # site_credentials: 'Site credentials'
35 top: 36 top:
36 add_new_entry: 'Yeni bir makale ekle' 37 add_new_entry: 'Yeni bir makale ekle'
37 search: 'Ara' 38 search: 'Ara'
@@ -89,9 +90,10 @@ config:
89 token_reset: 'Belirteci (token) sıfırla' 90 token_reset: 'Belirteci (token) sıfırla'
90 rss_links: 'RSS akış bağlantıları' 91 rss_links: 'RSS akış bağlantıları'
91 rss_link: 92 rss_link:
92 unread: 'okunmayan' 93 unread: 'Okunmayan'
93 starred: 'favoriler' 94 starred: 'Favoriler'
94 archive: 'arşiv' 95 archive: 'Arşiv'
96 # all: 'All'
95 rss_limit: 'RSS içeriğinden talep edilecek makale limiti' 97 rss_limit: 'RSS içeriğinden talep edilecek makale limiti'
96 form_user: 98 form_user:
97 two_factor_description: "İki adımlı doğrulamayı aktifleştirdiğinizde, her yeni güvenilmeyen bağlantılarda size e-posta ile bir kod alacaksınız." 99 two_factor_description: "İki adımlı doğrulamayı aktifleştirdiğinizde, her yeni güvenilmeyen bağlantılarda size e-posta ile bir kod alacaksınız."
@@ -571,3 +573,8 @@ flashes:
571 # added: 'User "%username%" added' 573 # added: 'User "%username%" added'
572 # updated: 'User "%username%" updated' 574 # updated: 'User "%username%" updated'
573 # deleted: 'User "%username%" deleted' 575 # deleted: 'User "%username%" deleted'
576 site_credential:
577 notice:
578 # added: 'Site credential for "%host%" added'
579 # updated: 'Site credential for "%host%" updated'
580 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
index 01f63a7b..2bf64cd6 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
@@ -82,7 +82,7 @@
82 <fieldset class="w500p inline"> 82 <fieldset class="w500p inline">
83 <div class="row"> 83 <div class="row">
84 <h3>{{ 'config.form_settings.android_configuration'|trans }}</h3> 84 <h3>{{ 'config.form_settings.android_configuration'|trans }}</h3>
85 <a href="wallabag://{{ app.user.username }}@{{ wallabag_url }}" >Touch here to prefill your Android application</a> 85 <a href="wallabag://{{ app.user.username }}@{{ wallabag_url }}">Touch here to prefill your Android application</a>
86 <br/> 86 <br/>
87 <img id="androidQrcode" /> 87 <img id="androidQrcode" />
88 <script> 88 <script>
@@ -106,7 +106,7 @@
106 106
107 <fieldset class="w500p inline"> 107 <fieldset class="w500p inline">
108 <div class="row"> 108 <div class="row">
109 <label>Rss token</label> 109 <label>{{ 'config.form_rss.token_label'|trans }}</label>
110 {% if rss.token %} 110 {% if rss.token %}
111 {{ rss.token }} 111 {{ rss.token }}
112 {% else %} 112 {% else %}
@@ -128,9 +128,10 @@
128 <div class="row"> 128 <div class="row">
129 <label>{{ 'config.form_rss.rss_links'|trans }}</label> 129 <label>{{ 'config.form_rss.rss_links'|trans }}</label>
130 <ul> 130 <ul>
131 <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">unread</a></li> 131 <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.unread'|trans }}</a></li>
132 <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">fav</a></li> 132 <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.starred'|trans }}</a></li>
133 <li><a href="{{ path('archive_rss', {'username': rss.username, 'token': rss.token}) }}">archives</a></li> 133 <li><a href="{{ path('archive_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.archive'|trans }}</a></li>
134 <li><a href="{{ path('all_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.all'|trans }}</a></li>
134 </ul> 135 </ul>
135 </div> 136 </div>
136 </fieldset> 137 </fieldset>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
index 6c26d5bf..6424df8d 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
@@ -1,5 +1,12 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %} 1{% extends "WallabagCoreBundle::layout.html.twig" %}
2 2
3{% block head %}
4 {{ parent() }}
5 {% if tag is defined and app.user.config.rssToken %}
6 <link rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" />
7 {% endif %}
8{% endblock %}
9
3{% block title %} 10{% block title %}
4 {% set filter = '' %} 11 {% set filter = '' %}
5 {% if tag is defined %} 12 {% if tag is defined %}
@@ -12,12 +19,15 @@
12{% endblock %} 19{% endblock %}
13 20
14{% block content %} 21{% block content %}
15 22 {% set currentRoute = app.request.attributes.get('_route') %}
16 {% set listMode = app.user.config.listMode %} 23 {% set listMode = app.user.config.listMode %}
17 <div class="results"> 24 <div class="results">
18 <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div> 25 <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
19 <div class="pagination"> 26 <div class="pagination">
20 <a href="{{ path('switch_view_mode') }}"><i class="listMode-btn material-icons md-24">{% if listMode == 0 %}list{% else %}view_module{% endif %}</i></a> 27 <a href="{{ path('switch_view_mode') }}"><i class="listMode-btn material-icons md-24">{% if listMode == 0 %}list{% else %}view_module{% endif %}</i></a>
28 {% if app.user.config.rssToken %}
29 {% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %}
30 {% endif %}
21 <i class="btn-clickable download-btn material-icons md-24 js-export-action">file_download</i> 31 <i class="btn-clickable download-btn material-icons md-24 js-export-action">file_download</i>
22 <i class="btn-clickable filter-btn material-icons md-24 js-filters-action">filter_list</i> 32 <i class="btn-clickable filter-btn material-icons md-24 js-filters-action">filter_list</i>
23 {% if entries.getNbPages > 1 %} 33 {% if entries.getNbPages > 1 %}
@@ -76,7 +86,6 @@
76 86
77 <!-- Export --> 87 <!-- Export -->
78 <aside id="download-form"> 88 <aside id="download-form">
79 {% set currentRoute = app.request.attributes.get('_route') %}
80 {% set currentTag = '' %} 89 {% set currentTag = '' %}
81 {% if tag is defined %} 90 {% if tag is defined %}
82 {% set currentTag = tag %} 91 {% set currentTag = tag %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/edit.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/edit.html.twig
new file mode 100644
index 00000000..882be430
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/edit.html.twig
@@ -0,0 +1,60 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{{ 'site_credential.page_title'|trans }}{% endblock %}
4
5{% block content %}
6
7 <div class="row">
8 <div class="col s12">
9 <div class="card-panel">
10 <div class="row">
11 <div class="input-field col s12">
12 <h4>{{ 'site_credential.edit_site_credential'|trans }}</h4>
13
14 <div id="set6" class="col s12">
15 {{ form_start(edit_form) }}
16 {{ form_errors(edit_form) }}
17
18 <div class="row">
19 <div class="input-field col s12">
20 {{ form_label(edit_form.host) }}
21 {{ form_errors(edit_form.host) }}
22 {{ form_widget(edit_form.host) }}
23 </div>
24 </div>
25
26 <div class="row">
27 <div class="input-field col s12">
28 {{ form_label(edit_form.username) }}
29 {{ form_errors(edit_form.username) }}
30 {{ form_widget(edit_form.username) }}
31 </div>
32 </div>
33
34 <div class="row">
35 <div class="input-field col s12">
36 {{ form_label(edit_form.password) }}
37 {{ form_errors(edit_form.password) }}
38 {{ form_widget(edit_form.password) }}
39 </div>
40 </div>
41
42 <br/>
43
44 {{ form_widget(edit_form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
45 {{ form_widget(edit_form._token) }}
46 </form>
47 <p>
48 {{ form_start(delete_form) }}
49 <button onclick="return confirm('{{ 'site_credential.form.delete_confirm'|trans|escape('js') }}')" type="submit" class="btn waves-effect waves-light red">{{ 'site_credential.form.delete'|trans }}</button>
50 {{ form_end(delete_form) }}
51 </p>
52 <p><a class="waves-effect waves-light btn blue-grey" href="{{ path('site_credentials_index') }}">{{ 'site_credential.form.back_to_list'|trans }}</a></p>
53 </div>
54 </div>
55 </div>
56 </div>
57 </div>
58 </div>
59
60{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/index.html.twig
new file mode 100644
index 00000000..324854ad
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/index.html.twig
@@ -0,0 +1,42 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{{ 'site_credential.page_title'|trans }}{% endblock %}
4
5{% block content %}
6
7 <div class="row">
8 <div class="col s12">
9 <div class="card-panel">
10 <div class="row">
11 <div class="input-field col s12">
12 <p class="help">{{ 'site_credential.description'|trans|raw }}</p>
13
14 <table class="bordered">
15 <thead>
16 <tr>
17 <th>{{ 'site_credential.form.host_label'|trans }}</th>
18 <th>{{ 'site_credential.list.actions'|trans }}</th>
19 </tr>
20 </thead>
21 <tbody>
22 {% for credential in credentials %}
23 <tr>
24 <td>{{ credential.host }}</td>
25 <td>
26 <a href="{{ path('site_credentials_edit', { 'id': credential.id }) }}">{{ 'site_credential.list.edit_action'|trans }}</a>
27 </td>
28 </tr>
29 {% endfor %}
30 </tbody>
31 </table>
32 <br />
33 <p>
34 <a href="{{ path('site_credentials_new') }}" class="waves-effect waves-light btn">{{ 'site_credential.list.create_new_one'|trans }}</a>
35 </p>
36 </div>
37 </div>
38 </div>
39 </div>
40 </div>
41
42{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/new.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/new.html.twig
new file mode 100644
index 00000000..3c008cde
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/new.html.twig
@@ -0,0 +1,53 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{{ 'site_credential.page_title'|trans }}{% endblock %}
4
5{% block content %}
6
7 <div class="row">
8 <div class="col s12">
9 <div class="card-panel">
10 <div class="row">
11 <div class="input-field col s12">
12 <h4>{{ 'site_credential.new_site_credential'|trans }}</h4>
13
14 <div id="set6" class="col s12">
15 {{ form_start(form) }}
16 {{ form_errors(form) }}
17
18 <div class="row">
19 <div class="input-field col s12">
20 {{ form_label(form.host) }}
21 {{ form_errors(form.host) }}
22 {{ form_widget(form.host) }}
23 </div>
24 </div>
25
26 <div class="row">
27 <div class="input-field col s12">
28 {{ form_label(form.username) }}
29 {{ form_errors(form.username) }}
30 {{ form_widget(form.username) }}
31 </div>
32 </div>
33
34 <div class="row">
35 <div class="input-field col s12">
36 {{ form_label(form.password) }}
37 {{ form_errors(form.password) }}
38 {{ form_widget(form.password) }}
39 </div>
40 </div>
41
42 {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
43 {{ form_rest(form) }}
44 </form>
45 <p><a class="waves-effect waves-light btn blue-grey" href="{{ path('site_credentials_index') }}">{{ 'site_credential.form.back_to_list'|trans }}</a></p>
46 </div>
47 </div>
48 </div>
49 </div>
50 </div>
51 </div>
52
53{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig
index 7509918e..070d5629 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig
@@ -9,7 +9,12 @@
9 9
10 <ul> 10 <ul>
11 {% for tag in tags %} 11 {% for tag in tags %}
12 <li id="tag-{{ tag.id|e }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a></li> 12 <li id="tag-{{ tag.id|e }}">
13 <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a>
14 <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right">
15 <i class="material-icons md-24">rss_feed</i>
16 </a>
17 </li>
13 {% endfor %} 18 {% endfor %}
14 </ul> 19 </ul>
15 20
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
index 42aeace9..17fa13bb 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
@@ -38,6 +38,9 @@
38 {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }} 38 {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
39 </div> 39 </div>
40 </li> 40 </li>
41 {% if craue_setting('restricted_access') %}
42 <li class="menu site_credentials"><a href="{{ path('site_credentials_index') }}">{{ 'menu.left.site_credentials'|trans }}</a></li>
43 {% endif %}
41 <li class="menu config"><a href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a></li> 44 <li class="menu config"><a href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a></li>
42 {% if is_granted('ROLE_SUPER_ADMIN') %} 45 {% if is_granted('ROLE_SUPER_ADMIN') %}
43 <li class="menu users"><a href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a></li> 46 <li class="menu users"><a href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a></li>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig
new file mode 100644
index 00000000..2bf9b2bd
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig
@@ -0,0 +1,6 @@
1{% if tag is defined %}
2 <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right"><i class="material-icons md-24">rss_feed</i></a>
3{% elseif currentRoute in ['unread', 'starred', 'archive', 'all'] %}
4 <a rel="alternate" type="application/rss+xml" href="{{ path(currentRoute ~ '_rss', {'username': app.user.username, 'token': app.user.config.rssToken}) }}" class="right"><i class="material-icons">rss_feed</i></a>
5{% endif %}
6
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/entries.xml.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/entries.xml.twig
index 12e8c79f..d70aa5dc 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/entries.xml.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/entries.xml.twig
@@ -1,8 +1,8 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/"> 2<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
3 <channel> 3 <channel>
4 <title>wallabag {{type}} feed</title> 4 <title>wallabag - {{ type }} feed</title>
5 <link>{{ url(type) }}</link> 5 <link>{{ url_html }}</link>
6 <link rel="self" href="{{ app.request.uri }}"/> 6 <link rel="self" href="{{ app.request.uri }}"/>
7 {% if entries.hasPreviousPage -%} 7 {% if entries.hasPreviousPage -%}
8 <link rel="previous" href="{{ url }}?page={{ entries.previousPage }}"/> 8 <link rel="previous" href="{{ url }}?page={{ entries.previousPage }}"/>
@@ -13,7 +13,7 @@
13 <link rel="last" href="{{ url }}?page={{ entries.nbPages }}"/> 13 <link rel="last" href="{{ url }}?page={{ entries.nbPages }}"/>
14 <pubDate>{{ "now"|date('D, d M Y H:i:s') }}</pubDate> 14 <pubDate>{{ "now"|date('D, d M Y H:i:s') }}</pubDate>
15 <generator>wallabag</generator> 15 <generator>wallabag</generator>
16 <description>wallabag {{type}} elements</description> 16 <description>wallabag {{ type }} elements</description>
17 17
18 {% for entry in entries %} 18 {% for entry in entries %}
19 19
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
index 9b0816eb..f290cb49 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
@@ -66,13 +66,13 @@
66 </div> 66 </div>
67 </div> 67 </div>
68 68
69 <div class="row"> 69 <div class="row">
70 <div class="input-field col s12"> 70 <div class="input-field col s12">
71 {{ form_errors(form.config.action_mark_as_read) }} 71 {{ form_label(form.config.action_mark_as_read) }}
72 {{ form_widget(form.config.action_mark_as_read) }} 72 {{ form_errors(form.config.action_mark_as_read) }}
73 {{ form_label(form.config.action_mark_as_read) }} 73 {{ form_widget(form.config.action_mark_as_read) }}
74 </div>
74 </div> 75 </div>
75 </div>
76 76
77 <div class="row"> 77 <div class="row">
78 <div class="input-field col s11"> 78 <div class="input-field col s11">
@@ -157,6 +157,7 @@
157 <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.unread'|trans }}</a></li> 157 <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.unread'|trans }}</a></li>
158 <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.starred'|trans }}</a></li> 158 <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.starred'|trans }}</a></li>
159 <li><a href="{{ path('archive_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.archive'|trans }}</a></li> 159 <li><a href="{{ path('archive_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.archive'|trans }}</a></li>
160 <li><a href="{{ path('all_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.all'|trans }}</a></li>
160 </ul> 161 </ul>
161 </div> 162 </div>
162 </div> 163 </div>
@@ -254,11 +255,11 @@
254 {{ form_start(form.pwd) }} 255 {{ form_start(form.pwd) }}
255 {{ form_errors(form.pwd) }} 256 {{ form_errors(form.pwd) }}
256 257
257 <div class="row"> 258 <div class="row">
258 <div class="input-field col s12"> 259 <div class="input-field col s12">
259 {{ 'config.form_password.description'|trans }} 260 {{ 'config.form_password.description'|trans }}
261 </div>
260 </div> 262 </div>
261 </div>
262 263
263 <div class="row"> 264 <div class="row">
264 <div class="input-field col s12"> 265 <div class="input-field col s12">
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
index 5ba42057..0c4dc80b 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
@@ -1,9 +1,16 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %} 1{% extends "WallabagCoreBundle::layout.html.twig" %}
2 2
3{% block head %}
4 {{ parent() }}
5 {% if tag is defined and app.user.config.rssToken %}
6 <link rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" />
7 {% endif %}
8{% endblock %}
9
3{% block title %} 10{% block title %}
4 {% set filter = '' %} 11 {% set filter = '' %}
5 {% if tag is defined %} 12 {% if tag is defined %}
6 {% set filter = tag %} 13 {% set filter = tag.slug %}
7 {% endif %} 14 {% endif %}
8 {% if searchTerm is defined and searchTerm is not empty %} 15 {% if searchTerm is defined and searchTerm is not empty %}
9 {% set filter = searchTerm %} 16 {% set filter = searchTerm %}
@@ -13,10 +20,14 @@
13 20
14{% block content %} 21{% block content %}
15 {% set listMode = app.user.config.listMode %} 22 {% set listMode = app.user.config.listMode %}
23 {% set currentRoute = app.request.attributes.get('_route') %}
16 <div class="results clearfix"> 24 <div class="results clearfix">
17 <div class="nb-results left"> 25 <div class="nb-results left">
18 {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} 26 {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
19 <a href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if listMode == 0 %}view_list{% else %}view_module{% endif %}</i></a> 27 <a href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if listMode == 0 %}view_list{% else %}view_module{% endif %}</i></a>
28 {% if app.user.config.rssToken %}
29 {% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %}
30 {% endif %}
20 </div> 31 </div>
21 {% if entries.getNbPages > 1 %} 32 {% if entries.getNbPages > 1 %}
22 {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} 33 {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
@@ -46,10 +57,9 @@
46 57
47 <!-- Export --> 58 <!-- Export -->
48 <div id="export" class="side-nav right-aligned"> 59 <div id="export" class="side-nav right-aligned">
49 {% set currentRoute = app.request.attributes.get('_route') %}
50 {% set currentTag = '' %} 60 {% set currentTag = '' %}
51 {% if tag is defined %} 61 {% if tag is defined %}
52 {% set currentTag = tag %} 62 {% set currentTag = tag.slug %}
53 {% endif %} 63 {% endif %}
54 {% if currentRoute == 'homepage' %} 64 {% if currentRoute == 'homepage' %}
55 {% set currentRoute = 'unread' %} 65 {% set currentRoute = 'unread' %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/edit.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/edit.html.twig
new file mode 100644
index 00000000..882be430
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/edit.html.twig
@@ -0,0 +1,60 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{{ 'site_credential.page_title'|trans }}{% endblock %}
4
5{% block content %}
6
7 <div class="row">
8 <div class="col s12">
9 <div class="card-panel">
10 <div class="row">
11 <div class="input-field col s12">
12 <h4>{{ 'site_credential.edit_site_credential'|trans }}</h4>
13
14 <div id="set6" class="col s12">
15 {{ form_start(edit_form) }}
16 {{ form_errors(edit_form) }}
17
18 <div class="row">
19 <div class="input-field col s12">
20 {{ form_label(edit_form.host) }}
21 {{ form_errors(edit_form.host) }}
22 {{ form_widget(edit_form.host) }}
23 </div>
24 </div>
25
26 <div class="row">
27 <div class="input-field col s12">
28 {{ form_label(edit_form.username) }}
29 {{ form_errors(edit_form.username) }}
30 {{ form_widget(edit_form.username) }}
31 </div>
32 </div>
33
34 <div class="row">
35 <div class="input-field col s12">
36 {{ form_label(edit_form.password) }}
37 {{ form_errors(edit_form.password) }}
38 {{ form_widget(edit_form.password) }}
39 </div>
40 </div>
41
42 <br/>
43
44 {{ form_widget(edit_form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
45 {{ form_widget(edit_form._token) }}
46 </form>
47 <p>
48 {{ form_start(delete_form) }}
49 <button onclick="return confirm('{{ 'site_credential.form.delete_confirm'|trans|escape('js') }}')" type="submit" class="btn waves-effect waves-light red">{{ 'site_credential.form.delete'|trans }}</button>
50 {{ form_end(delete_form) }}
51 </p>
52 <p><a class="waves-effect waves-light btn blue-grey" href="{{ path('site_credentials_index') }}">{{ 'site_credential.form.back_to_list'|trans }}</a></p>
53 </div>
54 </div>
55 </div>
56 </div>
57 </div>
58 </div>
59
60{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/index.html.twig
new file mode 100644
index 00000000..324854ad
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/index.html.twig
@@ -0,0 +1,42 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{{ 'site_credential.page_title'|trans }}{% endblock %}
4
5{% block content %}
6
7 <div class="row">
8 <div class="col s12">
9 <div class="card-panel">
10 <div class="row">
11 <div class="input-field col s12">
12 <p class="help">{{ 'site_credential.description'|trans|raw }}</p>
13
14 <table class="bordered">
15 <thead>
16 <tr>
17 <th>{{ 'site_credential.form.host_label'|trans }}</th>
18 <th>{{ 'site_credential.list.actions'|trans }}</th>
19 </tr>
20 </thead>
21 <tbody>
22 {% for credential in credentials %}
23 <tr>
24 <td>{{ credential.host }}</td>
25 <td>
26 <a href="{{ path('site_credentials_edit', { 'id': credential.id }) }}">{{ 'site_credential.list.edit_action'|trans }}</a>
27 </td>
28 </tr>
29 {% endfor %}
30 </tbody>
31 </table>
32 <br />
33 <p>
34 <a href="{{ path('site_credentials_new') }}" class="waves-effect waves-light btn">{{ 'site_credential.list.create_new_one'|trans }}</a>
35 </p>
36 </div>
37 </div>
38 </div>
39 </div>
40 </div>
41
42{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/new.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/new.html.twig
new file mode 100644
index 00000000..3c008cde
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/SiteCredential/new.html.twig
@@ -0,0 +1,53 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{{ 'site_credential.page_title'|trans }}{% endblock %}
4
5{% block content %}
6
7 <div class="row">
8 <div class="col s12">
9 <div class="card-panel">
10 <div class="row">
11 <div class="input-field col s12">
12 <h4>{{ 'site_credential.new_site_credential'|trans }}</h4>
13
14 <div id="set6" class="col s12">
15 {{ form_start(form) }}
16 {{ form_errors(form) }}
17
18 <div class="row">
19 <div class="input-field col s12">
20 {{ form_label(form.host) }}
21 {{ form_errors(form.host) }}
22 {{ form_widget(form.host) }}
23 </div>
24 </div>
25
26 <div class="row">
27 <div class="input-field col s12">
28 {{ form_label(form.username) }}
29 {{ form_errors(form.username) }}
30 {{ form_widget(form.username) }}
31 </div>
32 </div>
33
34 <div class="row">
35 <div class="input-field col s12">
36 {{ form_label(form.password) }}
37 {{ form_errors(form.password) }}
38 {{ form_widget(form.password) }}
39 </div>
40 </div>
41
42 {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
43 {{ form_rest(form) }}
44 </form>
45 <p><a class="waves-effect waves-light btn blue-grey" href="{{ path('site_credentials_index') }}">{{ 'site_credential.form.back_to_list'|trans }}</a></p>
46 </div>
47 </div>
48 </div>
49 </div>
50 </div>
51 </div>
52
53{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig
index c83543ac..97ddedc9 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig
@@ -14,6 +14,9 @@
14 {% for tag in tags %} 14 {% for tag in tags %}
15 <li title="{{tag.label}} ({{ tag.nbEntries }})" id="tag-{{ tag.id }}" class="col l2 m2 s5"> 15 <li title="{{tag.label}} ({{ tag.nbEntries }})" id="tag-{{ tag.id }}" class="col l2 m2 s5">
16 <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a> 16 <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a>
17 {% if app.user.config.rssToken %}
18 <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right"><i class="material-icons">rss_feed</i></a>
19 {% endif %}
17 </li> 20 </li>
18 {% endfor %} 21 {% endfor %}
19 </ul> 22 </ul>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
index 2dab1c18..60907e11 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
@@ -66,6 +66,11 @@
66 <li class="bold {% if currentRoute == 'config' %}active{% endif %}"> 66 <li class="bold {% if currentRoute == 'config' %}active{% endif %}">
67 <a class="waves-effect" href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a> 67 <a class="waves-effect" href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a>
68 </li> 68 </li>
69 {% if craue_setting('restricted_access') %}
70 <li class="bold {% if currentRoute starts with 'site_credentials_' %}active{% endif %}">
71 <a class="waves-effect" href="{{ path('site_credentials_index') }}">{{ 'menu.left.site_credentials'|trans }}</a>
72 </li>
73 {% endif %}
69 {% if is_granted('ROLE_SUPER_ADMIN') %} 74 {% if is_granted('ROLE_SUPER_ADMIN') %}
70 <li class="bold {% if currentRoute starts with 'user_' %}active{% endif %}"> 75 <li class="bold {% if currentRoute starts with 'user_' %}active{% endif %}">
71 <a class="waves-effect" href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a> 76 <a class="waves-effect" href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a>