File tree Expand file tree Collapse file tree
plugins/system/datacompliancecookie Expand file tree Collapse file tree Original file line number Diff line number Diff 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 /**
You can’t perform that action at this time.
0 commit comments