Skip to content

Commit c5fb257

Browse files
author
Nicholas K. Dionysopoulos
committed
Don't let the cookie plugin get in the way of our components
DataCompliance and LoginGuard both serve captive pages. Cookie consent should be obtained outside the captive logins to prevent conflicts.
1 parent c6d9e57 commit c5fb257

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

plugins/system/datacompliancecookie/datacompliancecookie.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,42 @@ public function onAfterInitialise()
330330
{
331331
$this->removeAllCookies();
332332
}
333+
334+
/**
335+
* Only for the frontend.
336+
*
337+
* If I am inside a page of Data Compliance or LoginGuard I should not show the cookie acceptance banner.
338+
* These components are special cases. The former requires the user to provide their consent to their
339+
* personal information being processed, the latter is two step verification. If I block their interface
340+
* they block the cookie banner functionality, therefore the user cannot do anything!
341+
*/
342+
if (!$this->container->platform->isFrontend())
343+
{
344+
// I am not in the frontend. Nothing to do.
345+
return;
346+
}
347+
348+
if ($this->hasCookiePreference)
349+
{
350+
// The user has already provided a preference, the banner won't be shown anyway.
351+
return;
352+
}
353+
354+
if ($option == 'com_datacompliance')
355+
{
356+
// The user is trying to give / revoke their consent or export / delete their profile.
357+
$this->enabled = false;
358+
359+
return;
360+
}
361+
362+
if ($option == 'com_loginguard')
363+
{
364+
// The user is trying to undergo two step verification.
365+
$this->enabled = false;
366+
367+
return;
368+
}
333369
}
334370

335371
/**

0 commit comments

Comments
 (0)