FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...
The new GDPR rules require to manage cookie more specific. Meanwhile it's not enough to say "Yeah Cookies, go ahead", you need to make them available for separate sections and allow the user to allow/deny every single cookie.
This tiny extension allows you to define all cookies and trackers you use on your website. A configuration page allows the (anonymize) visitor to allow/deny each single setting.
In your code you can check every setting for a user and react accordingly to show maybe some information or just leave out the code which tracks your visitor.
Install the extension to your application via either of the methods detailed below (Git submodule / CommandBox + ForgeBox)
From the root of your application, type the following command:
git submodule add https://gitlab.com/madmike_de/preside-ext-gdpr.git application/extensions/preside-ext-gdpr
From the root of your application type the following command:
box install preside-ext-gdpr
From the Preside CMS developer console reload the application:
The most funny thing about the GDPR cookie stuff is that you need to identify the individual user. This is happening with a - right: Cookie. The visitor ist completely anonymous and is automatically generated as a UUID using the Preside visitorService.getVisitorId().
As long as the VisitogID exists, the saved settings are checked and validated. When the VisitorID changes or the settings are deleted for this VisitorID the GDPR Dialog is shown again and all(!!) cookies are denied until the user allows them again.
Three datamanager objects are definied by the extension:
A pagetype gdpr is defined as a systempage. This page is showing a form with all grpritems, grouped by grprgroup and allows the user to allow/deny each single setting. The permissions are saved in the object gdprpermission per individual user.
There are several system setting for button labels, etc.
To show the annoying dialog to a visitor, asking for permission, do the following:
put the viewlet code at the start of your layout (must be before the first
gdprDialog = renderViewlet( event="gdpr._gdprDialog" );
at the end of your layout output the viewlet (must be before
If the automatic generated visitorID can't be found in the gdprpermission object the dialog will be shown. Otherwise the visitor already did some settings and the dialog will not be shown.
Each gdpr item has a shortcode. This shortcode can be used as a simple identifier of the item. The shortcode can be used in the validation function. To check if a user allowed or denied the access of a permission use the following:
The functions return true/false when the permission for this item is allowed/denied.
<cfif gdrpIsAllowed('googleanalytics)> ... insert google analytics code here ... </cfif>
Code released under the MIT licence.
See SilkTide licence for details.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
gdprIsAllowed()function as a helper function.
this is the initial version with the following features:
Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.
|Version||Created||Last Update||Published By||Stable||Actions|
|0.2.0||Mar 09 2020 08:43 AM||Mar 09 2020 08:43 AM|
|0.1.5||Feb 28 2020 08:45 AM||Feb 28 2020 08:45 AM|
|0.1.2||Feb 18 2020 10:16 AM||Feb 18 2020 10:16 AM|
|0.1.1||Feb 18 2020 09:59 AM||Feb 18 2020 09:59 AM|
|0.1.0||Feb 17 2020 01:05 PM||Feb 17 2020 01:05 PM|
box install preside-ext-gdpr