aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php118
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php9
-rw-r--r--src/Wallabag/CoreBundle/Controller/RssController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/StaticController.php5
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php133
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/Configuration.php16
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php7
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php7
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml12
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/base.html.twig4
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig19
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig3
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig16
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig14
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig25
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig3
-rw-r--r--src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php1
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/SettingsControllerTest.php32
-rw-r--r--src/Wallabag/ImportBundle/Controller/PocketController.php1
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php5
-rw-r--r--src/Wallabag/ImportBundle/Resources/config/services.yml2
-rw-r--r--src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig6
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php11
-rw-r--r--src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php14
-rw-r--r--src/Wallabag/UserBundle/Resources/config/services.yml3
-rw-r--r--src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php14
27 files changed, 407 insertions, 76 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 63032dbb..e6a06eea 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -12,6 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface;
12use Symfony\Component\Console\Question\ConfirmationQuestion; 12use Symfony\Component\Console\Question\ConfirmationQuestion;
13use Symfony\Component\Console\Question\Question; 13use Symfony\Component\Console\Question\Question;
14use Wallabag\CoreBundle\Entity\Config; 14use Wallabag\CoreBundle\Entity\Config;
15use Craue\ConfigBundle\Entity\Setting;
15 16
16class InstallCommand extends ContainerAwareCommand 17class InstallCommand extends ContainerAwareCommand
17{ 18{
@@ -204,13 +205,122 @@ class InstallCommand extends ContainerAwareCommand
204 $em->persist($user); 205 $em->persist($user);
205 206
206 $config = new Config($user); 207 $config = new Config($user);
207 $config->setTheme($this->getContainer()->getParameter('theme')); 208 $config->setTheme($this->getContainer()->getParameter('wallabag_core.theme'));
208 $config->setItemsPerPage($this->getContainer()->getParameter('items_on_page')); 209 $config->setItemsPerPage($this->getContainer()->getParameter('wallabag_core.items_on_page'));
209 $config->setRssLimit($this->getContainer()->getParameter('rss_limit')); 210 $config->setRssLimit($this->getContainer()->getParameter('wallabag_core.rss_limit'));
210 $config->setLanguage($this->getContainer()->getParameter('language')); 211 $config->setLanguage($this->getContainer()->getParameter('wallabag_core.language'));
211 212
212 $em->persist($config); 213 $em->persist($config);
213 214
215 // cleanup before insert new stuff
216 $em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute();
217
218 $settings = [
219 [
220 'name' => 'download_pictures',
221 'value' => '1',
222 'section' => 'entry',
223 ],
224 [
225 'name' => 'carrot',
226 'value' => '1',
227 'section' => 'entry',
228 ],
229 [
230 'name' => 'share_diaspora',
231 'value' => '1',
232 'section' => 'entry',
233 ],
234 [
235 'name' => 'diaspora_url',
236 'value' => 'http://diasporapod.com',
237 'section' => 'entry',
238 ],
239 [
240 'name' => 'share_shaarli',
241 'value' => '1',
242 'section' => 'entry',
243 ],
244 [
245 'name' => 'shaarli_url',
246 'value' => 'http://myshaarli.com',
247 'section' => 'entry',
248 ],
249 [
250 'name' => 'share_mail',
251 'value' => '1',
252 'section' => 'entry',
253 ],
254 [
255 'name' => 'share_twitter',
256 'value' => '1',
257 'section' => 'entry',
258 ],
259 [
260 'name' => 'export_epub',
261 'value' => '1',
262 'section' => 'export',
263 ],
264 [
265 'name' => 'export_mobi',
266 'value' => '1',
267 'section' => 'export',
268 ],
269 [
270 'name' => 'export_pdf',
271 'value' => '1',
272 'section' => 'export',
273 ],
274 [
275 'name' => 'export_csv',
276 'value' => '1',
277 'section' => 'export',
278 ],
279 [
280 'name' => 'export_json',
281 'value' => '1',
282 'section' => 'export',
283 ],
284 [
285 'name' => 'export_txt',
286 'value' => '1',
287 'section' => 'export',
288 ],
289 [
290 'name' => 'export_xml',
291 'value' => '1',
292 'section' => 'export',
293 ],
294 [
295 'name' => 'pocket_consumer_key',
296 'value' => null,
297 'section' => 'import',
298 ],
299 [
300 'name' => 'show_printlink',
301 'value' => '1',
302 'section' => 'entry',
303 ],
304 [
305 'name' => 'wallabag_support_url',
306 'value' => 'https://www.wallabag.org/pages/support.html',
307 'section' => 'misc',
308 ],
309 [
310 'name' => 'wallabag_url',
311 'value' => 'http://v2.wallabag.org',
312 'section' => 'misc',
313 ],
314 ];
315
316 foreach ($settings as $setting) {
317 $newSetting = new Setting();
318 $newSetting->setName($setting['name']);
319 $newSetting->setValue($setting['value']);
320 $newSetting->setSection($setting['section']);
321 $em->persist($newSetting);
322 }
323
214 $em->flush(); 324 $em->flush();
215 325
216 $this->defaultOutput->writeln(''); 326 $this->defaultOutput->writeln('');
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index b01aaa7f..b7799746 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -133,10 +133,10 @@ class ConfigController extends Controller
133 $userManager->updateUser($newUser, true); 133 $userManager->updateUser($newUser, true);
134 134
135 $config = new Config($newUser); 135 $config = new Config($newUser);
136 $config->setTheme($this->container->getParameter('theme')); 136 $config->setTheme($this->getParameter('wallabag_core.theme'));
137 $config->setItemsPerPage($this->container->getParameter('items_on_page')); 137 $config->setItemsPerPage($this->getParameter('wallabag_core.items_on_page'));
138 $config->setRssLimit($this->container->getParameter('rss_limit')); 138 $config->setRssLimit($this->getParameter('wallabag_core.rss_limit'));
139 $config->setLanguage($this->container->getParameter('language')); 139 $config->setLanguage($this->getParameter('wallabag_core.language'));
140 140
141 $em->persist($config); 141 $em->persist($config);
142 142
@@ -163,6 +163,7 @@ class ConfigController extends Controller
163 'username' => $user->getUsername(), 163 'username' => $user->getUsername(),
164 'token' => $config->getRssToken(), 164 'token' => $config->getRssToken(),
165 ), 165 ),
166 'twofactor_auth' => $this->getParameter('twofactor_auth'),
166 )); 167 ));
167 } 168 }
168 169
diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php
index 2b7ef598..a4f7a200 100644
--- a/src/Wallabag/CoreBundle/Controller/RssController.php
+++ b/src/Wallabag/CoreBundle/Controller/RssController.php
@@ -84,7 +84,7 @@ class RssController extends Controller
84 $pagerAdapter = new DoctrineORMAdapter($qb->getQuery()); 84 $pagerAdapter = new DoctrineORMAdapter($qb->getQuery());
85 $entries = new Pagerfanta($pagerAdapter); 85 $entries = new Pagerfanta($pagerAdapter);
86 86
87 $perPage = $user->getConfig()->getRssLimit() ?: $this->container->getParameter('rss_limit'); 87 $perPage = $user->getConfig()->getRssLimit() ?: $this->getParameter('wallabag_core.rss_limit');
88 $entries->setMaxPerPage($perPage); 88 $entries->setMaxPerPage($perPage);
89 89
90 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array( 90 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php
index 9ada371b..5b7bd56e 100644
--- a/src/Wallabag/CoreBundle/Controller/StaticController.php
+++ b/src/Wallabag/CoreBundle/Controller/StaticController.php
@@ -25,7 +25,10 @@ class StaticController extends Controller
25 { 25 {
26 return $this->render( 26 return $this->render(
27 'WallabagCoreBundle:Static:about.html.twig', 27 'WallabagCoreBundle:Static:about.html.twig',
28 array() 28 array(
29 'version' => $this->getParameter('wallabag_core.version'),
30 'paypal_url' => $this->getParameter('wallabag_core.paypal_url'),
31 )
29 ); 32 );
30 } 33 }
31 34
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
new file mode 100644
index 00000000..5e89c2a9
--- /dev/null
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
@@ -0,0 +1,133 @@
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 Craue\ConfigBundle\Entity\Setting;
9
10class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface
11{
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $settings = [
18 [
19 'name' => 'download_pictures',
20 'value' => '1',
21 'section' => 'entry',
22 ],
23 [
24 'name' => 'carrot',
25 'value' => '1',
26 'section' => 'entry',
27 ],
28 [
29 'name' => 'share_diaspora',
30 'value' => '1',
31 'section' => 'entry',
32 ],
33 [
34 'name' => 'diaspora_url',
35 'value' => 'http://diasporapod.com',
36 'section' => 'entry',
37 ],
38 [
39 'name' => 'share_shaarli',
40 'value' => '1',
41 'section' => 'entry',
42 ],
43 [
44 'name' => 'shaarli_url',
45 'value' => 'http://myshaarli.com',
46 'section' => 'entry',
47 ],
48 [
49 'name' => 'share_mail',
50 'value' => '1',
51 'section' => 'entry',
52 ],
53 [
54 'name' => 'share_twitter',
55 'value' => '1',
56 'section' => 'entry',
57 ],
58 [
59 'name' => 'export_epub',
60 'value' => '1',
61 'section' => 'export',
62 ],
63 [
64 'name' => 'export_mobi',
65 'value' => '1',
66 'section' => 'export',
67 ],
68 [
69 'name' => 'export_pdf',
70 'value' => '1',
71 'section' => 'export',
72 ],
73 [
74 'name' => 'export_csv',
75 'value' => '1',
76 'section' => 'export',
77 ],
78 [
79 'name' => 'export_json',
80 'value' => '1',
81 'section' => 'export',
82 ],
83 [
84 'name' => 'export_txt',
85 'value' => '1',
86 'section' => 'export',
87 ],
88 [
89 'name' => 'export_xml',
90 'value' => '1',
91 'section' => 'export',
92 ],
93 [
94 'name' => 'pocket_consumer_key',
95 'value' => null,
96 'section' => 'import',
97 ],
98 [
99 'name' => 'show_printlink',
100 'value' => '1',
101 'section' => 'entry',
102 ],
103 [
104 'name' => 'wallabag_support_url',
105 'value' => 'https://www.wallabag.org/pages/support.html',
106 'section' => 'misc',
107 ],
108 [
109 'name' => 'wallabag_url',
110 'value' => 'http://v2.wallabag.org',
111 'section' => 'misc',
112 ],
113 ];
114
115 foreach ($settings as $setting) {
116 $newSetting = new Setting();
117 $newSetting->setName($setting['name']);
118 $newSetting->setValue($setting['value']);
119 $newSetting->setSection($setting['section']);
120 $manager->persist($newSetting);
121 }
122
123 $manager->flush();
124 }
125
126 /**
127 * {@inheritdoc}
128 */
129 public function getOrder()
130 {
131 return 50;
132 }
133}
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
index 32acd1f1..bc405fdc 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
@@ -17,6 +17,22 @@ class Configuration implements ConfigurationInterface
17 ->arrayNode('languages') 17 ->arrayNode('languages')
18 ->prototype('scalar')->end() 18 ->prototype('scalar')->end()
19 ->end() 19 ->end()
20 ->integerNode('items_on_page')
21 ->defaultValue(12)
22 ->end()
23 ->scalarNode('theme')
24 ->defaultValue('material')
25 ->end()
26 ->scalarNode('language')
27 ->defaultValue('en')
28 ->end()
29 ->integerNode('rss_limit')
30 ->defaultValue(50)
31 ->end()
32 ->scalarNode('version')
33 ->end()
34 ->scalarNode('paypal_url')
35 ->end()
20 ->end() 36 ->end()
21 ; 37 ;
22 38
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index 9ff9b732..9b4703e4 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -13,7 +13,14 @@ class WallabagCoreExtension extends Extension
13 { 13 {
14 $configuration = new Configuration(); 14 $configuration = new Configuration();
15 $config = $this->processConfiguration($configuration, $configs); 15 $config = $this->processConfiguration($configuration, $configs);
16
16 $container->setParameter('wallabag_core.languages', $config['languages']); 17 $container->setParameter('wallabag_core.languages', $config['languages']);
18 $container->setParameter('wallabag_core.items_on_page', $config['items_on_page']);
19 $container->setParameter('wallabag_core.theme', $config['theme']);
20 $container->setParameter('wallabag_core.language', $config['language']);
21 $container->setParameter('wallabag_core.rss_limit', $config['rss_limit']);
22 $container->setParameter('wallabag_core.version', $config['version']);
23 $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
17 24
18 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 25 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
19 $loader->load('services.yml'); 26 $loader->load('services.yml');
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
index 31a80d6e..965a40b6 100644
--- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php
+++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
@@ -8,6 +8,7 @@ use JMS\Serializer\SerializerBuilder;
8use PHPePub\Core\EPub; 8use PHPePub\Core\EPub;
9use PHPePub\Core\Structure\OPF\DublinCore; 9use PHPePub\Core\Structure\OPF\DublinCore;
10use Symfony\Component\HttpFoundation\Response; 10use Symfony\Component\HttpFoundation\Response;
11use Craue\ConfigBundle\Util\Config;
11 12
12/** 13/**
13 * This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest. 14 * This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest.
@@ -27,12 +28,12 @@ class EntriesExport
27 </div'; 28 </div';
28 29
29 /** 30 /**
30 * @param string $wallabagUrl Wallabag instance url 31 * @param Config $craueConfig CraueConfig instance to get wallabag instance url from database
31 * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE 32 * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE
32 */ 33 */
33 public function __construct($wallabagUrl, $logoPath) 34 public function __construct(Config $craueConfig, $logoPath)
34 { 35 {
35 $this->wallabagUrl = $wallabagUrl; 36 $this->wallabagUrl = $craueConfig->get('wallabag_url');
36 $this->logoPath = $logoPath; 37 $this->logoPath = $logoPath;
37 } 38 }
38 39
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 7d24d488..a8796fe4 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -3,7 +3,7 @@ services:
3 class: Wallabag\CoreBundle\Helper\DetectActiveTheme 3 class: Wallabag\CoreBundle\Helper\DetectActiveTheme
4 arguments: 4 arguments:
5 - "@security.token_storage" 5 - "@security.token_storage"
6 - %theme% # default theme from parameters.yml 6 - %wallabag_core.theme%
7 7
8 # custom form type 8 # custom form type
9 wallabag_core.form.type.config: 9 wallabag_core.form.type.config:
@@ -76,17 +76,17 @@ services:
76 class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener 76 class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener
77 arguments: 77 arguments:
78 - "@doctrine.orm.entity_manager" 78 - "@doctrine.orm.entity_manager"
79 - %theme% 79 - %wallabag_core.theme%
80 - %items_on_page% 80 - %wallabag_core.items_on_page%
81 - %rss_limit% 81 - %wallabag_core.rss_limit%
82 - %language% 82 - %wallabag_core.language%
83 tags: 83 tags:
84 - { name: kernel.event_subscriber } 84 - { name: kernel.event_subscriber }
85 85
86 wallabag_core.helper.entries_export: 86 wallabag_core.helper.entries_export:
87 class: Wallabag\CoreBundle\Helper\EntriesExport 87 class: Wallabag\CoreBundle\Helper\EntriesExport
88 arguments: 88 arguments:
89 - %wallabag_url% 89 - "@craue_config"
90 - src/Wallabag/CoreBundle/Resources/public/themes/_global/img/appicon/apple-touch-icon-152.png 90 - src/Wallabag/CoreBundle/Resources/public/themes/_global/img/appicon/apple-touch-icon-152.png
91 91
92 wallabag.operator.array.matches: 92 wallabag.operator.array.matches:
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index 20f4352b..cc814cc4 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -13,6 +13,7 @@ archive: 'Lus'
13all: 'Tous les articles' 13all: 'Tous les articles'
14tags: 'Tags' 14tags: 'Tags'
15config: 'Configuration' 15config: 'Configuration'
16internal settings: 'Configuration interne'
16import: 'Importer' 17import: 'Importer'
17howto: 'Aide' 18howto: 'Aide'
18logout: 'Déconnexion' 19logout: 'Déconnexion'
diff --git a/src/Wallabag/CoreBundle/Resources/views/base.html.twig b/src/Wallabag/CoreBundle/Resources/views/base.html.twig
index 9e515a17..1742b4aa 100644
--- a/src/Wallabag/CoreBundle/Resources/views/base.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/base.html.twig
@@ -68,10 +68,8 @@
68 68
69 {% block footer %}{% endblock %} 69 {% block footer %}{% endblock %}
70 70
71 {% if warning_message %}
72 <div id="warning_message"> 71 <div id="warning_message">
73 {{ warning_message | raw }} 72 You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
74 </div> 73 </div>
75 {% endif %}
76 </body> 74 </body>
77</html> 75</html>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
index c23d0e27..27a88287 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
@@ -11,16 +11,15 @@
11 <li><a title="{% if entry.isArchived == 0 %}{% trans %}Mark as read{% endtrans %}{% else %}{% trans %}Mark as unread{% endtrans %}{% endif %}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% if entry.isArchived == 0 %}{% trans %}Mark as read{% endtrans %}{% else %}{% trans %}Mark as unread{% endtrans %}{% endif %}</span></a></li> 11 <li><a title="{% if entry.isArchived == 0 %}{% trans %}Mark as read{% endtrans %}{% else %}{% trans %}Mark as unread{% endtrans %}{% endif %}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% if entry.isArchived == 0 %}{% trans %}Mark as read{% endtrans %}{% else %}{% trans %}Mark as unread{% endtrans %}{% endif %}</span></a></li>
12 <li><a title="{% trans %}Favorite{% endtrans %}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle favorite{% endtrans %}</span></a></li> 12 <li><a title="{% trans %}Favorite{% endtrans %}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle favorite{% endtrans %}</span></a></li>
13 <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}Delete{% endtrans %}</span></a></li> 13 <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}Delete{% endtrans %}</span></a></li>
14 {% if share_twitter %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}Tweet{% endtrans %}"><span>{% trans %}Tweet{% endtrans %}</span></a></li>{% endif %} 14 {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}Tweet{% endtrans %}"><span>{% trans %}Tweet{% endtrans %}</span></a></li>{% endif %}
15 {% if share_mail %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %} 15 {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %}
16 {% if share_shaarli %}<li><a href="{{ shaarli_url }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %} 16 {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %}
17 {% if share_diaspora %}<li><a href="{{ diaspora_url }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans %}diaspora{% endtrans %}"><span>{% trans %}diaspora{% endtrans %}</span></a></li>{% endif %} 17 {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans %}diaspora{% endtrans %}"><span>{% trans %}diaspora{% endtrans %}</span></a></li>{% endif %}
18 {# {% if flattr %}{% if flattr.status == flattrable %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}"><span>{% trans %}flattr{% endtrans %}</span></a></li>{% elseif flattr.status == flattred %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}><span>{% trans %}flattr{% endtrans %}</span> ({{ flattr.numFlattrs }})</a></li>{% endif %}{% endif %} #} 18 {% if craue_setting('carrot') %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans %}carrot{% endtrans %}"><span>Carrot</span></a></li>{% endif %}
19 {% if carrot %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans %}carrot{% endtrans %}"><span>Carrot</span></a></li>{% endif %} 19 {% if craue_setting('show_printlink') %}<li><a title="{% trans %}Print{% endtrans %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans %}Print{% endtrans %}</span></a></li>{% endif %}
20 {% if show_printlink %}<li><a title="{% trans %}Print{% endtrans %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans %}Print{% endtrans %}</span></a></li>{% endif %} 20 {% if craue_setting('export_epub') %}<li><a href="?epub&amp;method=id&amp;value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %}
21 {% if export_epub %}<li><a href="?epub&amp;method=id&amp;value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %} 21 {% if craue_setting('export_mobi') %}<li><a href="?mobi&amp;method=id&amp;value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
22 {% if export_mobi %}<li><a href="?mobi&amp;method=id&amp;value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %} 22 {% if craue_setting('export_pdf') %}<li><a href="?pdf&amp;method=id&amp;value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %}
23 {% if export_pdf %}<li><a href="?pdf&amp;method=id&amp;value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %}
24 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans %}Does this article appear wrong?{% endtrans %}" class="tool bad-display icon icon-delete"><span>{% trans %}Does this article appear wrong?{% endtrans %}</span></a></li> 23 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans %}Does this article appear wrong?{% endtrans %}" class="tool bad-display icon icon-delete"><span>{% trans %}Does this article appear wrong?{% endtrans %}</span></a></li>
25 </ul> 24 </ul>
26 </div> 25 </div>
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 3aead497..b630070c 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
@@ -51,6 +51,9 @@
51 </div> 51 </div>
52 </li> 52 </li>
53 <li><a href="{{ path('config') }}">{% trans %}config{% endtrans %}</a></li> 53 <li><a href="{{ path('config') }}">{% trans %}config{% endtrans %}</a></li>
54 {% if is_granted('ROLE_SUPER_ADMIN') %}
55 <li><a href="{{ path('craue_config_settings_modify') }}">{% trans %}internal settings{% endtrans %}</a></li>
56 {% endif %}
54 <li><a href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li> 57 <li><a href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li>
55 <li><a href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li> 58 <li><a href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li>
56 <li><a href="{{ path('about') }}">{% trans %}about{% endtrans %}</a></li> 59 <li><a href="{{ path('about') }}">{% trans %}about{% endtrans %}</a></li>
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 8743dc1d..1cae90a4 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
@@ -11,14 +11,14 @@
11 <div class="row"> 11 <div class="row">
12 <div class="div_tabs col s12"> 12 <div class="div_tabs col s12">
13 <ul class="tabs"> 13 <ul class="tabs">
14 <li class="tab col s3"><a class="active" href="#set1">{% trans %}Settings{% endtrans %}</a></li> 14 <li class="tab col s3"><a class="active" href="#set1">{% trans %}Settings{% endtrans %}</a></li>
15 <li class="tab col s3"><a href="#set2">{% trans %}RSS{% endtrans %}</a></li> 15 <li class="tab col s3"><a href="#set2">{% trans %}RSS{% endtrans %}</a></li>
16 <li class="tab col s3"><a href="#set3">{% trans %}User information{% endtrans %}</a></li> 16 <li class="tab col s3"><a href="#set3">{% trans %}User information{% endtrans %}</a></li>
17 <li class="tab col s3"><a href="#set4">{% trans %}Password{% endtrans %}</a></li> 17 <li class="tab col s3"><a href="#set4">{% trans %}Password{% endtrans %}</a></li>
18 <li class="tab col s3"><a href="#set5">{% trans %}Tagging rules{% endtrans %}</a></li> 18 <li class="tab col s3"><a href="#set5">{% trans %}Tagging rules{% endtrans %}</a></li>
19 {% if is_granted('ROLE_SUPER_ADMIN') %} 19 {% if is_granted('ROLE_SUPER_ADMIN') %}
20 <li class="tab col s3"><a href="#set6">{% trans %}Add a user{% endtrans %}</a></li> 20 <li class="tab col s3"><a href="#set6">{% trans %}Add a user{% endtrans %}</a></li>
21 {% endif %} 21 {% endif %}
22 </ul> 22 </ul>
23 </div> 23 </div>
24 24
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 0c35de2d..8ad24fbf 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
@@ -101,13 +101,13 @@
101 {% endif %} 101 {% endif %}
102 <h4 class="center">{% trans %}Export{% endtrans %}</h4> 102 <h4 class="center">{% trans %}Export{% endtrans %}</h4>
103 <ul> 103 <ul>
104 {% if export_epub %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub' }) }}">{% trans %}EPUB{% endtrans %}</a></li>{% endif %} 104 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub' }) }}">{% trans %}EPUB{% endtrans %}</a></li>{% endif %}
105 {% if export_mobi %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi' }) }}">{% trans %}MOBI{% endtrans %}</a></li>{% endif %} 105 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi' }) }}">{% trans %}MOBI{% endtrans %}</a></li>{% endif %}
106 {% if export_pdf %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf' }) }}">{% trans %}PDF{% endtrans %}</a></li>{% endif %} 106 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf' }) }}">{% trans %}PDF{% endtrans %}</a></li>{% endif %}
107 {% if export_xml %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml' }) }}">{% trans %}XML{% endtrans %}</a></li>{% endif %} 107 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml' }) }}">{% trans %}XML{% endtrans %}</a></li>{% endif %}
108 {% if export_csv %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json' }) }}">{% trans %}JSON{% endtrans %}</a></li>{% endif %} 108 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json' }) }}">{% trans %}JSON{% endtrans %}</a></li>{% endif %}
109 {% if export_json %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv' }) }}">{% trans %}CSV{% endtrans %}</a></li>{% endif %} 109 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv' }) }}">{% trans %}CSV{% endtrans %}</a></li>{% endif %}
110 {% if export_txt %}<li class="bold"><del><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt' }) }}">{% trans %}TXT{% endtrans %}</a></del></li>{% endif %} 110 {% if craue_setting('export_txt') %}<li class="bold"><del><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt' }) }}">{% trans %}TXT{% endtrans %}</a></del></li>{% endif %}
111 </ul> 111 </ul>
112 </div> 112 </div>
113 113
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
index 31963ae8..dad96187 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
@@ -97,12 +97,11 @@
97 </a> 97 </a>
98 <div class="collapsible-body"> 98 <div class="collapsible-body">
99 <ul> 99 <ul>
100 {% if share_twitter %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}twitter{% endtrans %}"><span>{% trans %}twitter{% endtrans %}</span></a></li>{% endif %} 100 {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}twitter{% endtrans %}"><span>{% trans %}twitter{% endtrans %}</span></a></li>{% endif %}
101 {% if share_shaarli %}<li><a href="{{ shaarli_url }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %} 101 {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %}
102 {% if share_diaspora %}<li><a href="{{ diaspora_url }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans %}diaspora*{% endtrans %}"><span>{% trans %}diaspora*{% endtrans %}</span></a></li>{% endif %} 102 {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans %}diaspora*{% endtrans %}"><span>{% trans %}diaspora*{% endtrans %}</span></a></li>{% endif %}
103 {# {% if flattr %}{% if flattr.status == flattrable %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}"><span>{% trans %}flattr{% endtrans %}</span></a></li>{% elseif flattr.status == flattred %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}><span>{% trans %}flattr{% endtrans %}</span> ({{ flattr.numFlattrs }})</a></li>{% endif %}{% endif %} #} 103 {% if craue_setting('carrot') %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans %}carrot{% endtrans %}"><span>Carrot</span></a></li>{% endif %}
104 {% if carrot %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans %}carrot{% endtrans %}"><span>Carrot</span></a></li>{% endif %} 104 {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %}
105 {% if share_mail %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %}
106 </ul> 105 </ul>
107 </div> 106 </div>
108 </li> 107 </li>
@@ -114,13 +113,13 @@
114 </a> 113 </a>
115 <div class="collapsible-body"> 114 <div class="collapsible-body">
116 <ul> 115 <ul>
117 {% if export_epub %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'epub' }) }}" title="Generate ePub file">EPUB</a></li>{% endif %} 116 {% if craue_setting('export_epub') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'epub' }) }}" title="Generate ePub file">EPUB</a></li>{% endif %}
118 {% if export_mobi %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'mobi' }) }}" title="Generate Mobi file">MOBI</a></li>{% endif %} 117 {% if craue_setting('export_mobi') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'mobi' }) }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
119 {% if export_pdf %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'pdf' }) }}" title="Generate PDF file">PDF</a></li>{% endif %} 118 {% if craue_setting('export_pdf') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'pdf' }) }}" title="Generate PDF file">PDF</a></li>{% endif %}
120 {% if export_csv %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'csv' }) }}" title="Generate CSV file">CSV</a></li>{% endif %} 119 {% if craue_setting('export_csv') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'csv' }) }}" title="Generate CSV file">CSV</a></li>{% endif %}
121 {% if export_json %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'json' }) }}" title="Generate JSON file">JSON</a></li>{% endif %} 120 {% if craue_setting('export_json') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'json' }) }}" title="Generate JSON file">JSON</a></li>{% endif %}
122 {% if export_txt %}<li><del><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'txt' }) }}" title="Generate TXT file">TXT</a></del></li>{% endif %} 121 {% if craue_setting('export_txt') %}<li><del><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'txt' }) }}" title="Generate TXT file">TXT</a></del></li>{% endif %}
123 {% if export_xml %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'xml' }) }}" title="Generate XML file">XML</a></li>{% endif %} 122 {% if craue_setting('export_xml') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'xml' }) }}" title="Generate XML file">XML</a></li>{% endif %}
124 </ul> 123 </ul>
125 </div> 124 </div>
126 </li> 125 </li>
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 a8b6dc3f..dff9e612 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
@@ -45,6 +45,9 @@
45 <li class="bold border-bottom {% if currentRoute == 'all' %}active{% endif %}"><a class="waves-effect" href="{{ path('all') }}">{% trans %}all{% endtrans %}</a></li> 45 <li class="bold border-bottom {% if currentRoute == 'all' %}active{% endif %}"><a class="waves-effect" href="{{ path('all') }}">{% trans %}all{% endtrans %}</a></li>
46 <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}"><a class="waves-effect" href="{{ path('tag') }}">{% trans %}tags{% endtrans %}</a></li> 46 <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}"><a class="waves-effect" href="{{ path('tag') }}">{% trans %}tags{% endtrans %}</a></li>
47 <li class="bold {% if currentRoute == 'config' %}active{% endif %}"><a class="waves-effect" href="{{ path('config') }}">{% trans %}config{% endtrans %}</a></li> 47 <li class="bold {% if currentRoute == 'config' %}active{% endif %}"><a class="waves-effect" href="{{ path('config') }}">{% trans %}config{% endtrans %}</a></li>
48 {% if is_granted('ROLE_SUPER_ADMIN') %}
49 <li class="bold border-bottom {% if currentRoute == 'craue_config_settings_modify' %}active{% endif %}"><a class="waves-effect" href="{{ path('craue_config_settings_modify') }}">{% trans %}internal settings{% endtrans %}</a></li>
50 {% endif %}
48 <li class="bold {% if currentRoute == 'import' %}active{% endif %}"><a class="waves-effect" href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li> 51 <li class="bold {% if currentRoute == 'import' %}active{% endif %}"><a class="waves-effect" href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li>
49 <li class="bold {% if currentRoute == 'howto' %}active{% endif %}"><a class="waves-effect" href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li> 52 <li class="bold {% if currentRoute == 'howto' %}active{% endif %}"><a class="waves-effect" href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li>
50 <li class="bold"><a class="waves-effect" class="icon icon-power" href="{{ path('fos_user_security_logout') }}" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li> 53 <li class="bold"><a class="waves-effect" class="icon icon-power" href="{{ path('fos_user_security_logout') }}" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li>
diff --git a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php
index 7d75e2b7..a79d7b90 100644
--- a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php
@@ -81,6 +81,7 @@ class InstallCommandTest extends WallabagCoreTestCase
81 81
82 $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay()); 82 $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay());
83 $this->assertContains('Step 2 of 4. Setting up database.', $tester->getDisplay()); 83 $this->assertContains('Step 2 of 4. Setting up database.', $tester->getDisplay());
84 $this->assertContains('Droping database, creating database and schema, clearing the cache', $tester->getDisplay());
84 $this->assertContains('Step 3 of 4. Administration setup.', $tester->getDisplay()); 85 $this->assertContains('Step 3 of 4. Administration setup.', $tester->getDisplay());
85 $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay()); 86 $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay());
86 87
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/SettingsControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/SettingsControllerTest.php
new file mode 100644
index 00000000..fd698b3e
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Tests/Controller/SettingsControllerTest.php
@@ -0,0 +1,32 @@
1<?php
2
3namespace Wallabag\CoreBundle\Tests\Controller;
4
5use Wallabag\CoreBundle\Tests\WallabagCoreTestCase;
6
7/**
8 * The controller `SettingsController` does not exist.
9 * This test cover security against the internal settings page managed by CraueConfigBundle.
10 */
11class SettingsControllerTest extends WallabagCoreTestCase
12{
13 public function testSettingsWithAdmin()
14 {
15 $this->logInAs('admin');
16 $client = $this->getClient();
17
18 $crawler = $client->request('GET', '/settings');
19
20 $this->assertEquals(200, $client->getResponse()->getStatusCode());
21 }
22
23 public function testSettingsWithNormalUser()
24 {
25 $this->logInAs('bob');
26 $client = $this->getClient();
27
28 $crawler = $client->request('GET', '/settings');
29
30 $this->assertEquals(403, $client->getResponse()->getStatusCode());
31 }
32}
diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php
index 7aee302f..1c1b4fa8 100644
--- a/src/Wallabag/ImportBundle/Controller/PocketController.php
+++ b/src/Wallabag/ImportBundle/Controller/PocketController.php
@@ -15,6 +15,7 @@ class PocketController extends Controller
15 { 15 {
16 return $this->render('WallabagImportBundle:Pocket:index.html.twig', [ 16 return $this->render('WallabagImportBundle:Pocket:index.html.twig', [
17 'import' => $this->get('wallabag_import.pocket.import'), 17 'import' => $this->get('wallabag_import.pocket.import'),
18 'has_consumer_key' => '' == trim($this->get('craue_config')->get('pocket_consumer_key')) ? false : true,
18 ]); 19 ]);
19 } 20 }
20 21
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index 617d5514..22932238 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -11,6 +11,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
11use Wallabag\CoreBundle\Entity\Entry; 11use Wallabag\CoreBundle\Entity\Entry;
12use Wallabag\CoreBundle\Entity\Tag; 12use Wallabag\CoreBundle\Entity\Tag;
13use Wallabag\CoreBundle\Helper\ContentProxy; 13use Wallabag\CoreBundle\Helper\ContentProxy;
14use Craue\ConfigBundle\Util\Config;
14 15
15class PocketImport implements ImportInterface 16class PocketImport implements ImportInterface
16{ 17{
@@ -24,12 +25,12 @@ class PocketImport implements ImportInterface
24 private $importedEntries = 0; 25 private $importedEntries = 0;
25 protected $accessToken; 26 protected $accessToken;
26 27
27 public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, $consumerKey) 28 public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, Config $craueConfig)
28 { 29 {
29 $this->user = $tokenStorage->getToken()->getUser(); 30 $this->user = $tokenStorage->getToken()->getUser();
30 $this->em = $em; 31 $this->em = $em;
31 $this->contentProxy = $contentProxy; 32 $this->contentProxy = $contentProxy;
32 $this->consumerKey = $consumerKey; 33 $this->consumerKey = $craueConfig->get('pocket_consumer_key');
33 $this->logger = new NullLogger(); 34 $this->logger = new NullLogger();
34 } 35 }
35 36
diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml
index 6a11892e..e0942b1a 100644
--- a/src/Wallabag/ImportBundle/Resources/config/services.yml
+++ b/src/Wallabag/ImportBundle/Resources/config/services.yml
@@ -17,7 +17,7 @@ services:
17 - "@security.token_storage" 17 - "@security.token_storage"
18 - "@doctrine.orm.entity_manager" 18 - "@doctrine.orm.entity_manager"
19 - "@wallabag_core.content_proxy" 19 - "@wallabag_core.content_proxy"
20 - %pocket_consumer_key% 20 - "@craue_config"
21 calls: 21 calls:
22 - [ setClient, [ "@wallabag_import.pocket.client" ] ] 22 - [ setClient, [ "@wallabag_import.pocket.client" ] ]
23 - [ setLogger, [ "@logger" ]] 23 - [ setLogger, [ "@logger" ]]
diff --git a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig
index 643ad775..e0e36f38 100644
--- a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig
+++ b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig
@@ -5,6 +5,12 @@
5<div class="row"> 5<div class="row">
6 <div class="col s12"> 6 <div class="col s12">
7 <div class="card-panel settings"> 7 <div class="card-panel settings">
8 {% if not has_consumer_key %}
9 <div class="card-panel red darken-1">
10 {% trans %}Pocket import isn't configured. You need to define pocket_consumer_key.{% endtrans %}
11 </div>
12 {% endif %}
13
8 <blockquote>{{ import.description|trans }}</blockquote> 14 <blockquote>{{ import.description|trans }}</blockquote>
9 <p>{% trans %}You can import your data from your Pocket account. You just have to click on the below button and authorize the application to connect to getpocket.com.{% endtrans %}</p> 15 <p>{% trans %}You can import your data from your Pocket account. You just have to click on the below button and authorize the application to connect to getpocket.com.{% endtrans %}</p>
10 <form method="post" action="{{ path('import_pocket_auth') }}"> 16 <form method="post" action="{{ path('import_pocket_auth') }}">
diff --git a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
index 76225fe4..25359d56 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
@@ -55,11 +55,20 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
55 ->disableOriginalConstructor() 55 ->disableOriginalConstructor()
56 ->getMock(); 56 ->getMock();
57 57
58 $config = $this->getMockBuilder('Craue\ConfigBundle\Util\Config')
59 ->disableOriginalConstructor()
60 ->getMock();
61
62 $config->expects($this->any())
63 ->method('get')
64 ->with('pocket_consumer_key')
65 ->willReturn($consumerKey);
66
58 $pocket = new PocketImportMock( 67 $pocket = new PocketImportMock(
59 $this->tokenStorage, 68 $this->tokenStorage,
60 $this->em, 69 $this->em,
61 $this->contentProxy, 70 $this->contentProxy,
62 $consumerKey 71 $config
63 ); 72 );
64 73
65 $this->logHandler = new TestHandler(); 74 $this->logHandler = new TestHandler();
diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
index 6b108dd3..d8403491 100644
--- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
+++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
@@ -4,6 +4,7 @@ namespace Wallabag\UserBundle\Mailer;
4 4
5use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; 5use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
6use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; 6use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface;
7use Craue\ConfigBundle\Util\Config;
7 8
8/** 9/**
9 * Custom mailer for TwoFactorBundle email. 10 * Custom mailer for TwoFactorBundle email.
@@ -47,7 +48,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface
47 private $supportUrl; 48 private $supportUrl;
48 49
49 /** 50 /**
50 * Url for the wallabag instance. 51 * Url for the wallabag instance (only used for image in the HTML email template).
51 * 52 *
52 * @var string 53 * @var string
53 */ 54 */
@@ -60,17 +61,16 @@ class AuthCodeMailer implements AuthCodeMailerInterface
60 * @param \Twig_Environment $twig 61 * @param \Twig_Environment $twig
61 * @param string $senderEmail 62 * @param string $senderEmail
62 * @param string $senderName 63 * @param string $senderName
63 * @param string $supportUrl 64 * @param Config $craueConfig Craue\Config instance to get wallabag support url from database
64 * @param string $wallabagUrl
65 */ 65 */
66 public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) 66 public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, Config $craueConfig)
67 { 67 {
68 $this->mailer = $mailer; 68 $this->mailer = $mailer;
69 $this->twig = $twig; 69 $this->twig = $twig;
70 $this->senderEmail = $senderEmail; 70 $this->senderEmail = $senderEmail;
71 $this->senderName = $senderName; 71 $this->senderName = $senderName;
72 $this->supportUrl = $supportUrl; 72 $this->supportUrl = $craueConfig->get('wallabag_support_url');
73 $this->wallabagUrl = $wallabagUrl; 73 $this->wallabagUrl = $craueConfig->get('wallabag_url');
74 } 74 }
75 75
76 /** 76 /**
@@ -80,7 +80,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface
80 */ 80 */
81 public function sendAuthCode(TwoFactorInterface $user) 81 public function sendAuthCode(TwoFactorInterface $user)
82 { 82 {
83 $template = $this->twig->loadTemplate('@WallabagUserBundle/Resources/views/TwoFactor/email_auth_code.html.twig'); 83 $template = $this->twig->loadTemplate('WallabagUserBundle:TwoFactor:email_auth_code.html.twig');
84 84
85 $subject = $template->renderBlock('subject', array()); 85 $subject = $template->renderBlock('subject', array());
86 $bodyHtml = $template->renderBlock('body_html', [ 86 $bodyHtml = $template->renderBlock('body_html', [
diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml
index 8321473a..9a589332 100644
--- a/src/Wallabag/UserBundle/Resources/config/services.yml
+++ b/src/Wallabag/UserBundle/Resources/config/services.yml
@@ -11,8 +11,7 @@ services:
11 - "@twig" 11 - "@twig"
12 - "%scheb_two_factor.email.sender_email%" 12 - "%scheb_two_factor.email.sender_email%"
13 - "%scheb_two_factor.email.sender_name%" 13 - "%scheb_two_factor.email.sender_name%"
14 - "%wallabag_support_url%" 14 - "@craue_config"
15 - "%wallabag_url%"
16 15
17 wallabag_user.password_resetting: 16 wallabag_user.password_resetting:
18 class: Wallabag\UserBundle\EventListener\PasswordResettingListener 17 class: Wallabag\UserBundle\EventListener\PasswordResettingListener
diff --git a/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php b/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php
index e3f43a7e..b95e195e 100644
--- a/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php
+++ b/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php
@@ -26,6 +26,7 @@ class AuthCodeMailerTest extends \PHPUnit_Framework_TestCase
26 protected $mailer; 26 protected $mailer;
27 protected $spool; 27 protected $spool;
28 protected $twig; 28 protected $twig;
29 protected $config;
29 30
30 protected function setUp() 31 protected function setUp()
31 { 32 {
@@ -42,7 +43,15 @@ class AuthCodeMailerTest extends \PHPUnit_Framework_TestCase
42{% block body_text %}text body {{ support_url }}{% endblock %} 43{% block body_text %}text body {{ support_url }}{% endblock %}
43TWIG; 44TWIG;
44 45
45 $this->twig = new \Twig_Environment(new \Twig_Loader_Array(array('@WallabagUserBundle/Resources/views/TwoFactor/email_auth_code.html.twig' => $twigTemplate))); 46 $this->twig = new \Twig_Environment(new \Twig_Loader_Array(array('WallabagUserBundle:TwoFactor:email_auth_code.html.twig' => $twigTemplate)));
47
48 $this->config = $this->getMockBuilder('Craue\ConfigBundle\Util\Config')
49 ->disableOriginalConstructor()
50 ->getMock();
51
52 $this->config->expects($this->any())
53 ->method('get')
54 ->willReturn('http://0.0.0.0/support');
46 } 55 }
47 56
48 public function testSendEmail() 57 public function testSendEmail()
@@ -58,8 +67,7 @@ TWIG;
58 $this->twig, 67 $this->twig,
59 'nobody@test.io', 68 'nobody@test.io',
60 'wallabag test', 69 'wallabag test',
61 'http://0.0.0.0/support', 70 $this->config
62 'http://0.0.0.0'
63 ); 71 );
64 72
65 $authCodeMailer->sendAuthCode($user); 73 $authCodeMailer->sendAuthCode($user);