Skip to content

Commit 640cf82

Browse files
authored
Merge pull request #95 from RRZE-Webteam/dev
Dev
2 parents c284d2a + af8468b commit 640cf82

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

includes/Consent/Frontend.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ public static function handleLogAjaxRequest()
125125
// Frontend request
126126
if ($requestType == 'log' && !empty($_POST['cookieData'])) {
127127
echo json_encode([
128-
'success' => Log::add($_POST['cookieData']),
128+
// 'success' => Log::add($_POST['cookieData']),
129+
'success' => Log::delete(),
129130
]);
130131
} elseif ($requestType == 'consent_history' && !empty($_POST['uid'])) {
131132
echo json_encode(Log::getConsentHistory($_POST['uid']));

includes/Consent/Log.php

+12-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public static function add($cookieData)
7474

7575
/**
7676
* Get consent history.
77-
*
7877
* @param mixed $uid
7978
*/
8079
public static function getConsentHistory($uid)
@@ -93,6 +92,9 @@ public static function getConsentHistory($uid)
9392

9493
// Get logs
9594
$logs = get_option('rrze_legal_consent_log');
95+
if (!$logs || !is_array($logs)) {
96+
return $consentHistory;
97+
}
9698

9799
foreach ($logs as $logItem) {
98100
$consentList = [];
@@ -132,4 +134,13 @@ public static function getConsentHistory($uid)
132134

133135
return $consentHistory;
134136
}
137+
138+
/**
139+
* Delete consent log
140+
* @return void
141+
*/
142+
public static function delete()
143+
{
144+
return delete_option('rrze_legal_consent_log');
145+
}
135146
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rrze-legal",
3-
"version": "2.6.16",
3+
"version": "2.6.17",
44
"main": "rrze-legal.php",
55
"scripts": {
66
"start": "webpack --mode=development --watch",

rrze-legal.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: RRZE Legal
55
Plugin URI: https://gitlab.rrze.fau.de/rrze-webteam/rrze-legal
66
Description: Legal Mandatory Information & GDPR.
7-
Version: 2.6.16
7+
Version: 2.6.17
88
Author: RRZE Webteam
99
Author URI: https://blogs.fau.de/webworking/
1010
License: GNU General Public License Version 3

0 commit comments

Comments
 (0)