From d51093a7d964ca720793d0cfcf4af601f2de448a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 22 Nov 2016 15:58:00 +0100 Subject: [PATCH] Added documentation and missing translations --- .../translations/CraueConfigBundle.da.yml | 1 + .../translations/CraueConfigBundle.de.yml | 1 + .../translations/CraueConfigBundle.es.yml | 1 + .../translations/CraueConfigBundle.fa.yml | 1 + .../translations/CraueConfigBundle.fr.yml | 1 + .../translations/CraueConfigBundle.it.yml | 1 + .../translations/CraueConfigBundle.oc.yml | 1 + .../translations/CraueConfigBundle.pl.yml | 1 + .../translations/CraueConfigBundle.pt.yml | 1 + .../translations/CraueConfigBundle.ro.yml | 1 + .../translations/CraueConfigBundle.tr.yml | 1 + docs/de/developer/paywall.rst | 56 +++++++++++++++++++ docs/de/index.rst | 1 + docs/en/developer/paywall.rst | 56 +++++++++++++++++++ docs/en/index.rst | 1 + docs/fr/developer/paywall.rst | 56 +++++++++++++++++++ docs/fr/index.rst | 1 + .../CoreBundle/Helper/HttpClientFactory.php | 2 +- 18 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 docs/de/developer/paywall.rst create mode 100644 docs/en/developer/paywall.rst create mode 100644 docs/fr/developer/paywall.rst diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index fac3b4f8..c65463db 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Aktiver demo-indstilling? (anvendes kun til wallabags offent demo_mode_username: "Demobruger" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index d382733c..bc378147 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Test-Modus aktivieren? (nur für die öffentliche wallabag-D demo_mode_username: "Test-Benutzer" share_public: Erlaube eine öffentliche URL für Einträge # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index ff1dd04f..dbec0e81 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Activar modo demo (sólo usado para la demo de wallabag)" demo_mode_username: "Nombre de usuario demo" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index 4e712fdd..7a341e0b 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml @@ -32,3 +32,4 @@ modify_settings: "اعمال" # demo_mode_username: "Demo user" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index cae4c662..f5c886d6 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Activer le mode démo ? (utiliser uniquement pour la démo p demo_mode_username: "Utilisateur de la démo" share_public: Autoriser une URL publique pour les articles download_images_enabled: Télécharger les images en local +restricted_access: Activer l'authentification pour les articles derrière un paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index f94f834f..88a1b4f6 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Abilita modalità demo ? (usato solo per la demo pubblica di demo_mode_username: "Utente Demo" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index de60a194..00deeade 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Activar lo mode demostracion ? (utilizar solament per la dem demo_mode_username: "Utilizaire de la demostracion" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 11579745..744031e8 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Włacz tryb demo? (używany wyłącznie dla publicznej demon demo_mode_username: "Użytkownik Demonstracyjny" share_public: Zezwalaj na publiczny adres url dla wpisow # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml index 74ae5a44..1edde87a 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Habilitar modo demo? (somente usado para o demo público do demo_mode_username: "Usuário demo" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 5095dfa0..f0c935d3 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml @@ -32,3 +32,4 @@ modify_settings: "aplică" # demo_mode_username: "Demo user" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index cd42e595..eb40fc5e 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml @@ -32,3 +32,4 @@ # demo_mode_username: "Demo user" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/docs/de/developer/paywall.rst b/docs/de/developer/paywall.rst new file mode 100644 index 00000000..365027b4 --- /dev/null +++ b/docs/de/developer/paywall.rst @@ -0,0 +1,56 @@ +Articles behind a paywall +========================= + +wallabag can fetch articles from websites which use a paywall system. + +Enable paywall authentication +----------------------------- + +In internal settings, in the **Article** section, enable authentication for websites with paywall (with the value 1). + +Configure credentials in wallabag +--------------------------------- + +Edit your ``app/config/parameters.yml`` file to edit credentials for each website with paywall. Here is an example for some french websites: + +.. code:: yaml + + sites_credentials: + mediapart.fr: {username: "myMediapartLogin", password: "mypassword"} + arretsurimages.net: {username: "myASILogin", password: "mypassword"} + +.. note:: + + These credentials will be shared between each user of your wallabag instance. + +Parsing configuration files +--------------------------- + +.. note:: + + Read `this part of the documentation `_ to understand the configuration files. + +Each parsing configuration file needs to be improved by adding ``requires_login``, ``login_uri``, +``login_username_field``, ``login_password_field`` and ``not_logged_in_xpath``. + +Be careful, the login form must be in the page content when wallabag loads it. It's impossible for wallabag to be authenticated +on a website where the login form is loaded after the page (by ajax for example). + +``login_uri`` is the action URL of the form (``action`` attribute in the form). +``login_username_field`` is the ``name`` attribute of the login field. +``login_password_field`` is the ``name`` attribute of the password field. + +For example: + +.. code:: + + title://div[@id="titrage-contenu"]/h1[@class="title"] + body: //div[@class="contenu-html"]/div[@class="page-pane"] + + requires_login: yes + + login_uri: http://www.arretsurimages.net/forum/login.php + login_username_field: username + login_password_field: password + + not_logged_in_xpath: //body[@class="not-logged-in"] diff --git a/docs/de/index.rst b/docs/de/index.rst index c1ce7d4b..1c3e4873 100644 --- a/docs/de/index.rst +++ b/docs/de/index.rst @@ -46,6 +46,7 @@ Die Dokumentation ist in anderen Sprachen verfügbar : developer/api developer/docker + developer/paywall developer/documentation developer/translate developer/asynchronous diff --git a/docs/en/developer/paywall.rst b/docs/en/developer/paywall.rst new file mode 100644 index 00000000..365027b4 --- /dev/null +++ b/docs/en/developer/paywall.rst @@ -0,0 +1,56 @@ +Articles behind a paywall +========================= + +wallabag can fetch articles from websites which use a paywall system. + +Enable paywall authentication +----------------------------- + +In internal settings, in the **Article** section, enable authentication for websites with paywall (with the value 1). + +Configure credentials in wallabag +--------------------------------- + +Edit your ``app/config/parameters.yml`` file to edit credentials for each website with paywall. Here is an example for some french websites: + +.. code:: yaml + + sites_credentials: + mediapart.fr: {username: "myMediapartLogin", password: "mypassword"} + arretsurimages.net: {username: "myASILogin", password: "mypassword"} + +.. note:: + + These credentials will be shared between each user of your wallabag instance. + +Parsing configuration files +--------------------------- + +.. note:: + + Read `this part of the documentation `_ to understand the configuration files. + +Each parsing configuration file needs to be improved by adding ``requires_login``, ``login_uri``, +``login_username_field``, ``login_password_field`` and ``not_logged_in_xpath``. + +Be careful, the login form must be in the page content when wallabag loads it. It's impossible for wallabag to be authenticated +on a website where the login form is loaded after the page (by ajax for example). + +``login_uri`` is the action URL of the form (``action`` attribute in the form). +``login_username_field`` is the ``name`` attribute of the login field. +``login_password_field`` is the ``name`` attribute of the password field. + +For example: + +.. code:: + + title://div[@id="titrage-contenu"]/h1[@class="title"] + body: //div[@class="contenu-html"]/div[@class="page-pane"] + + requires_login: yes + + login_uri: http://www.arretsurimages.net/forum/login.php + login_username_field: username + login_password_field: password + + not_logged_in_xpath: //body[@class="not-logged-in"] diff --git a/docs/en/index.rst b/docs/en/index.rst index 54a1eef8..2e20aee6 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -46,6 +46,7 @@ The documentation is available in other languages: developer/api developer/docker + developer/paywall developer/documentation developer/translate developer/asynchronous diff --git a/docs/fr/developer/paywall.rst b/docs/fr/developer/paywall.rst new file mode 100644 index 00000000..c1c410b1 --- /dev/null +++ b/docs/fr/developer/paywall.rst @@ -0,0 +1,56 @@ +Articles derrière un paywall +============================ + +wallabag peut récupérer le contenu des articles des sites qui utilisent un système de paiement. + +Activer l'authentification pour les paywall +------------------------------------------- + +Dans les paramètres internes, section **Article**, activez l'authentification pour les articles derrière un paywall (avec la valeur 1). + +Configurer les accès dans wallabag +---------------------------------- + +Éditez le fichier ``app/config/parameters.yml`` pour modifier les accès aux sites avec paywall. Voici un exemple pour certains sites : + +.. code:: yaml + + sites_credentials: + mediapart.fr: {username: "myMediapartLogin", password: "mypassword"} + arretsurimages.net: {username: "myASILogin", password: "mypassword"} + +.. note:: + + Ces accès seront partagés entre chaque utilisateur de votre instance wallabag. + +Fichiers de configuration pour parser les articles +-------------------------------------------------- + +.. note:: + + Lisez `cette documentation `_ pour en savoir plus sur ces fichiers de configuration. + +Chaque fichier de configuration doit être enrichi en ajoutant ``requires_login``, ``login_uri``, +``login_username_field``, ``login_password_field`` et ``not_logged_in_xpath``. + +Attention, le formulaire de connexion doit se trouver dans le contenu de la page lors du chargement de celle-ci. +Il sera impossible pour wallabag de se connecter à un site dont le formulaire de connexion est chargé après coup (en ajax par exemple). + +``login_uri`` correspond à l'URL à laquelle le formulaire est soumis (attribut ``action`` du formulaire). +``login_username_field`` correspond à l'attribut ``name`` du champ de l'identifiant. +``login_password_field`` correspond à l'attribut ``name`` du champ du mot de passe. + +Par exemple : + +.. code:: + + title://div[@id="titrage-contenu"]/h1[@class="title"] + body: //div[@class="contenu-html"]/div[@class="page-pane"] + + requires_login: yes + + login_uri: http://www.arretsurimages.net/forum/login.php + login_username_field: username + login_password_field: password + + not_logged_in_xpath: //body[@class="not-logged-in"] diff --git a/docs/fr/index.rst b/docs/fr/index.rst index 8a4c600a..e3f14b04 100644 --- a/docs/fr/index.rst +++ b/docs/fr/index.rst @@ -47,6 +47,7 @@ La documentation est disponible dans d'autres langues : developer/api developer/docker + developer/paywall developer/documentation developer/translate developer/asynchronous diff --git a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php index ca84c8da..8891887b 100644 --- a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php +++ b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php @@ -25,7 +25,7 @@ class HttpClientFactory * * @param \GuzzleHttp\Event\SubscriberInterface $authenticatorSubscriber * @param \GuzzleHttp\Cookie\CookieJar $cookieJar - * @param string $restrictedAccess + * @param string $restrictedAccess this param is a kind of boolean. Values: 0 or 1 */ public function __construct(SubscriberInterface $authenticatorSubscriber, CookieJar $cookieJar, $restrictedAccess) { -- 2.41.0