heimrichhannot/contao-privacy
Composer 安装命令:
composer require heimrichhannot/contao-privacy
包简介
This bundle contains functionality concerning privacy and the European Union's "General Data Protection Regulation" (GDPR, in German: "Datenschutz-Grundverordnung", DSGVO).
README 文档
README
For Contao 4 and PHP 8 please use https://github.com/heimrichhannot/contao-privacy-bundle!
This bundle contains functionality concerning privacy and the European Union's "General Data Protection Regulation" (GDPR, in German: "Datenschutz-Grundverordnung", DSGVO).
Legal disclaimer
Use this bundle at your own risk. Although we as the developer try our best to design this bundle to fulfill the legal requirements we CAN'T GUARANTEE anything in terms completeness and correctness. Also we don't offer any legal consulting. We strongly encourage you to consult a lawyer if you have any questions or concerns.
Features
- privacy protocol
- adds the new Contao entities
tl_privacy_protocol_archiveandtl_privacy_protocol_entryfor storing privacy relevant actions like opt-ins, ... - offers a simply API for adding new entries into the privacy protocol
- offers functionality to create new privacy protocol entries for
tl_membercallbacks (oncreate_callback,onversion_callback,ondelete_callback)
- adds the new Contao entities
- opt-in/out form for the frontend with connection to privacy protocol
- backend opt in email module for "inviting" users to opt into a privacy relevant agreement
Installation
- Simply install using composer:
composer require heimrichhannot/contao-privacy - Update your database and clear your caches.
- Now you have the new menu entry "privacy" in the Contao menu on the left
Existing bundles supporting Contao Privacy Bundle
We already implemented support for some of our bundles:
- heimrichhannot/contao-formhybrid: This bundle offers the functionality to create DCA-powered forms in the frontend including callbacks, input types, email handling, and so on. By installing Contao Privacy Bundle you also get a checkbox for adding protocol entries after form submission.
- heimrichhannot/contao-cleaner-bundle: This bundle adds cleaner functionality for periodically removing arbitrary entities and/or files fulfilling a certain condition (using TL_CRON or your server's cron).
Export the privacy protocol
Export entries from the privacy protocol as csv or excel is already possible. In order to avail this feature, simply install one of the following composer modules:
- for contao 3.x:
composer require heimrichhannot/contao-exporter - for contao 4.x:
composer require heimrichhannot/contao-exporter-bundle
Usage
The privacy protocol
- Add a new protocol archive and select the fields you'd like to store (CAUTION: Do NOT store personal data for which you don't have the user's permission!).
- Choose one of the following functions for adding new entries programmatically and/or create entries after creating, updating or deleting members automatically.
Create entries on tl_member CRUD actions
You can activate the automated creation of privacy protocol entries for the following tl_member callbacks:
oncreate_callbackonversion_callback(this represents updating a member where at least one attribute has actually been changed)ondelete_callback
Just open contao's global settings (tl_settings) and configure to your needs in the "privacy" section.
Create entries programmatically
Add a new entry from the context of a module
class MyModule { // ... public function compile() { // this represents your function for sending the opt in email $success = $this->sendOptInEmail($firstname, $lastname, $email); // only create a protocol entry if the email has indeed been sent if ($success) { $protocolManager = new \HeimrichHannot\Privacy\Manager\ProtocolManager(); $protocolManager->addEntryFromModule( // the type of action \HeimrichHannot\Privacy\Backend\ProtocolEntry::TYPE_FIRST_OPT_IN, // the id of your destination protocol archive 1, // the data you want to add to the protocol entry to be created // CAUTION: Do NOT store personal data for which you don't have the user's permission! [ 'firstname' => $firstname, 'lastname' => $lastname, 'email' => $email ], // the \Contao\Module instance you're calling from $this, // optional: composer package name of the bundle your module lives in (version is retrieved automatically from composer.lock) 'acme/contao-my-bundle' ); } } // ... }
Add a new entry from the context of a content element
class MyContentElement { // ... public function compile() { // this represents your function for sending the opt in email $success = $this->sendOptInEmail($firstname, $lastname, $email); // only create a protocol entry if the email has indeed been sent if ($success) { $protocolManager = new \HeimrichHannot\Privacy\Manager\ProtocolManager(); $protocolManager->addEntryFromContentElement( // the type of action \HeimrichHannot\Privacy\Backend\ProtocolEntry::TYPE_FIRST_OPT_IN, // the id of your destination protocol archive 1, // the data you want to add to the protocol entry to be created // CAUTION: Do NOT store personal data for which you don't have the user's permission! [ 'firstname' => $firstname, 'lastname' => $lastname, 'email' => $email ], // the \Contao\ContentElement instance you're calling from $this, // optional: composer package name of the bundle your content element lives in (version is retrieved automatically from composer.lock) 'acme/contao-my-bundle' ); } } // ... }
Add a new entry from a general context
class MyClass { // ... public function someFunction() { // this represents your function for sending the opt in email $success = $this->sendOptInEmail($firstname, $lastname, $email); // only create a protocol entry if the email has indeed been sent if ($success) { $protocolManager = new \HeimrichHannot\Privacy\Manager\ProtocolManager(); $protocolManager->addEntry( // the type of action \HeimrichHannot\Privacy\Backend\ProtocolEntry::TYPE_FIRST_OPT_IN, // the id of your destination protocol archive 1, // the data you want to add to the protocol entry to be created // CAUTION: Do NOT store personal data for which you don't have the user's permission! [ 'firstname' => $firstname, 'lastname' => $lastname, 'email' => $email ], // optional: composer package name of the bundle your code lives in (version is retrieved automatically from composer.lock) 'acme/contao-my-bundle' ); } } // ... }
The Protocol Entry Editor
The module ModuleProtocolEntryEditor can be used to create entries in the privacy protocol. Typically you have the following scenarios:
Do a double opt-in for getting an agreement for some action (e.g. send advertising emails)
In this scenario you can:
- show a form with fields of a DCA specified by you (typically this would be
tl_member) -> here the user can type in his data (ATTENTION: Only ask for fields that are necessary for the action you're requesting the opt-in here) - this form can be prefilled using a prepared URL that can be generated by the insert tag
privacy_opt_url(see InsertTag chapter) - you can also avoid showing any fields by not selected any in the module configuration
- after clicking "submit" in the form, the user typically gets an email (using contao notification center) for confirming his agreement (you can skip the confirmation only if that's legally ok in your country)
- you can specify which protocol entries should generated after submit and after confirm
Do a single opt-out for revoking the agreement for some action (e.g. send advertising emails)
You can do that as you would do a single
The Backend Opt-In Form
Navigate to "opt-in" in the privacy section on the left for sending an opt-in email to a certain email address. The form works as follows:
- The information you type into the form is converted into an encrypted JWT token and appended to a prepared link (created with the insert tag
privacy_opt_url) in a notification email. - After the user clicks the link, he is redirected to a page containing the module
ModuleProtocolEntryEditor. This module recognizes the JWT parameter and uses it to prefill the form for the user so that he only has to click "Submit".
- HINT: The data you type into the backend opt-in form isn't directly stored into your database. The only case this happens is in an encrypted way as a JWT token in the notification queue of contao notification center. So use a module like
heimrichhannot/contao-cleaner-bundleto periodically delete this token data. *
Insert Tags
| Name | Arguments | Example |
|---|---|---|
| privacy_opt_url | 1. The data for prefilling the form of ModuleProtocolEntryEditor and for the resulting privacy protocol entry in the format: fieldName1:fieldValue1#fieldName2:fieldValue22. The jumpTo page id 3. The data for finding a corresponding database entity to be linked to the protocol entry (reference table and field is defined in the protocol entry editor's backend config): referenceFieldValue (optional) |
{{privacy_opt_url::email:john@example.org#firstname:John#lastname:Doe::1::john@example.org}} |
heimrichhannot/contao-privacy 适用场景与选型建议
heimrichhannot/contao-privacy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.41k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 05 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「protocol」 「contao」 「privacy」 「legal」 「gdpr」 「dsgvo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 heimrichhannot/contao-privacy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 heimrichhannot/contao-privacy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 heimrichhannot/contao-privacy 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Make TYPO3 more compatible to GDPR
Contao Open Source CMS
A small client implementing the Measurement Protocol for Google Analytics 4.
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
Yii2 Extension for sending push notification with both Firebase Cloud Messaging (FCM) HTTP Server Protocols (APIs).
Strips potentially identifying information from outbound requests to the WordPress.org API
统计信息
- 总下载量: 1.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2018-05-24