aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php5
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php5
-rw-r--r--src/Wallabag/CoreBundle/Helper/HttpClientFactory.php12
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml1
4 files changed, 21 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index e95c3a7b..f0738b91 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -432,6 +432,11 @@ class InstallCommand extends ContainerAwareCommand
432 'value' => '0', 432 'value' => '0',
433 'section' => 'misc', 433 'section' => 'misc',
434 ], 434 ],
435 [
436 'name' => 'restricted_access',
437 'value' => '0',
438 'section' => 'entry',
439 ],
435 ]; 440 ];
436 441
437 foreach ($settings as $setting) { 442 foreach ($settings as $setting) {
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
index 1f74891a..a723656e 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
@@ -155,6 +155,11 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface
155 'value' => '0', 155 'value' => '0',
156 'section' => 'misc', 156 'section' => 'misc',
157 ], 157 ],
158 [
159 'name' => 'restricted_access',
160 'value' => '0',
161 'section' => 'entry',
162 ],
158 ]; 163 ];
159 164
160 foreach ($settings as $setting) { 165 foreach ($settings as $setting) {
diff --git a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
index 161a5e9f..ca84c8da 100644
--- a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
+++ b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
@@ -18,23 +18,31 @@ class HttpClientFactory
18 /** @var \GuzzleHttp\Cookie\CookieJar */ 18 /** @var \GuzzleHttp\Cookie\CookieJar */
19 private $cookieJar; 19 private $cookieJar;
20 20
21 private $restrictedAccess;
22
21 /** 23 /**
22 * HttpClientFactory constructor. 24 * HttpClientFactory constructor.
23 * 25 *
24 * @param \GuzzleHttp\Event\SubscriberInterface $authenticatorSubscriber 26 * @param \GuzzleHttp\Event\SubscriberInterface $authenticatorSubscriber
25 * @param \GuzzleHttp\Cookie\CookieJar $cookieJar 27 * @param \GuzzleHttp\Cookie\CookieJar $cookieJar
28 * @param string $restrictedAccess
26 */ 29 */
27 public function __construct(SubscriberInterface $authenticatorSubscriber, CookieJar $cookieJar) 30 public function __construct(SubscriberInterface $authenticatorSubscriber, CookieJar $cookieJar, $restrictedAccess)
28 { 31 {
29 $this->authenticatorSubscriber = $authenticatorSubscriber; 32 $this->authenticatorSubscriber = $authenticatorSubscriber;
30 $this->cookieJar = $cookieJar; 33 $this->cookieJar = $cookieJar;
34 $this->restrictedAccess = $restrictedAccess;
31 } 35 }
32 36
33 /** 37 /**
34 * @return \GuzzleHttp\Client 38 * @return \GuzzleHttp\Client|null
35 */ 39 */
36 public function buildHttpClient() 40 public function buildHttpClient()
37 { 41 {
42 if (0 === (int) $this->restrictedAccess) {
43 return null;
44 }
45
38 // we clear the cookie to avoid websites who use cookies for analytics 46 // we clear the cookie to avoid websites who use cookies for analytics
39 $this->cookieJar->clear(); 47 $this->cookieJar->clear();
40 // need to set the (shared) cookie jar 48 // need to set the (shared) cookie jar
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 1b7f39fc..bcf0c9ca 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -73,6 +73,7 @@ services:
73 arguments: 73 arguments:
74 - "@bd_guzzle_site_authenticator.authenticator_subscriber" 74 - "@bd_guzzle_site_authenticator.authenticator_subscriber"
75 - "@wallabag_core.guzzle.cookie_jar" 75 - "@wallabag_core.guzzle.cookie_jar"
76 - '@=service(''craue_config'').get(''restricted_access'')'
76 77
77 wallabag_core.guzzle.cookie_jar: 78 wallabag_core.guzzle.cookie_jar:
78 class: GuzzleHttp\Cookie\FileCookieJar 79 class: GuzzleHttp\Cookie\FileCookieJar