{"id":21638791,"url":"https://github.com/novactive/novaezprotectedcontentbundle","last_synced_at":"2025-04-11T16:51:30.806Z","repository":{"id":57028650,"uuid":"130851912","full_name":"Novactive/NovaeZProtectedContentBundle","owner":"Novactive","description":"An eZ Platform bundle that provides quick protection on Contents","archived":false,"fork":false,"pushed_at":"2024-08-20T14:20:16.000Z","size":157,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-12-31T19:34:03.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Novactive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-24T12:37:54.000Z","updated_at":"2022-03-05T01:57:50.000Z","dependencies_parsed_at":"2024-05-27T22:17:26.330Z","dependency_job_id":"728bf57a-1123-4871-a0e0-c39fe05f4018","html_url":"https://github.com/Novactive/NovaeZProtectedContentBundle","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"15b73657003f951d4b5a84c953580b098304757b"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Novactive%2FNovaeZProtectedContentBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Novactive%2FNovaeZProtectedContentBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Novactive%2FNovaeZProtectedContentBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Novactive%2FNovaeZProtectedContentBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Novactive","download_url":"https://codeload.github.com/Novactive/NovaeZProtectedContentBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248443029,"owners_count":21104323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T04:11:43.379Z","updated_at":"2025-04-11T16:51:30.784Z","avatar_url":"https://github.com/Novactive.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Novactive eZ Protected Content Bundle\n\n----\n\nThis repository is what we call a \"subtree split\": a read-only copy of one directory of the main repository. \nIt is used by Composer to allow developers to depend on specific bundles.\n\nIf you want to report or contribute, you should instead open your issue on the main repository: https://github.com/Novactive/Nova-eZPlatform-Bundles\n\nDocumentation is available in this repository via `.md` files but also packaged here: https://novactive.github.io/Nova-eZPlatform-Bundles/master/ProtectedContentBundle/README.md.html\n\n----\n\n[![Downloads](https://img.shields.io/packagist/dt/novactive/ezprotectedcontentbundle.svg?style=flat-square)](https://packagist.org/packages/novactive/ezprotectedcontentbundle)\n[![Latest version](https://img.shields.io/github/release/Novactive/NovaeZProtectedContentBundle.svg?style=flat-square)](https://github.com/Novactive/NovaeZProtectedContentBundle/releases)\n[![License](https://img.shields.io/packagist/l/novactive/ezprotectedcontentbundle.svg?style=flat-square)](LICENSE)\n\nA bundle that provides quick password protection on Contents.\n\n## How does it work?\n\nAllows you to add 1 on N password on a Content in the Admin UI.\n\nOnce a Password is set, the Content becomes Protected. In this situation you will have 2 new variables in the view full.\nAllowing you do:\n\n```twig\n\u003ch2\u003e{{ ibexa_content_name(content) }}\u003c/h2\u003e\n{% if not canReadProtectedContent %}\n    \u003cp\u003eThis content has been protected by a password\u003c/p\u003e\n    \u003cdiv class=\"protected-content-form\"\u003e\n        {{ form(requestProtectedContentPasswordForm) }}\n    \u003c/div\u003e\n{% else %}\n    {% for field in content.fieldsByLanguage(language|default(null)) %}\n        \u003ch3\u003e{{ field.fieldDefIdentifier }}\u003c/h3\u003e\n        {{ ez_render_field(content, field.fieldDefIdentifier) }}\n    {% endfor %}\n{% endif %}\n```\n\nYou can also manage this globally through the pagelayout wrapping the content block.\n\nOnce you have unlocked the content, __canReadProtectedContent__ will be __true__ \n\n\u003e HTTP Cache is disabled for Protected Content.\n\n\n## Installation\n\n### Installation steps\n\nAdd the lib to your composer.json, run `composer require novactive/ezprotectedcontentbundle` to refresh dependencies.\n\nThen inject the bundle in the `bundles.php` of your application.\n\n```php\n    Novactive\\Bundle\\eZProtectedContentBundle\\NovaeZProtectedContentBundle::class =\u003e [ 'all'=\u003e true ],\n```\n\n### Add routes\n\n```yaml\n_novaezprotectedcontent_routes:\n    resource: '@NovaeZProtectedContentBundle/Resources/config/routing/main.yml'\n```\n\n### Install the database schema\n\n```bash\nbin/console novaezprotectedcontent:install\n```\n\n### Varnish\n\nThis module add a cookie to unlock the contents that match it, for that reason you want to keep all the cookie that \nstarts with PasswordProvided::COOKIE_PREFIX (i.e: **protected-content-**).\n\n```vcl\n // Remove all cookies besides Session ID, as JS tracker cookies and so will make the responses effectively un-cached\n    if (req.http.cookie) {\n        set req.http.cookie = \";\" + req.http.cookie;\n        set req.http.cookie = regsuball(req.http.cookie, \"; +\", \";\");\n        set req.http.cookie = regsuball(req.http.cookie, \";[ ]*(eZSESSID[^=]*|protected-content-[^=]*)=\", \"; \\1=\");\n        set req.http.cookie = regsuball(req.http.cookie, \";[^ ][^;]*\", \"\");\n        set req.http.cookie = regsuball(req.http.cookie, \"^[; ]+|[; ]+$\", \"\");\n    }\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovactive%2Fnovaezprotectedcontentbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnovactive%2Fnovaezprotectedcontentbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovactive%2Fnovaezprotectedcontentbundle/lists"}