From 23697125edf223ddbf841eeae3bb41716708b2dd Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Tue, 20 Aug 2019 21:08:59 +0200 Subject: [PATCH] More fixes to gdpr Signed-off-by: Janos SUTO --- webui/controller/message/rejectremove.php | 2 +- webui/model/search/search.php | 2 +- webui/view/javascript/piler-in.js | 4 +- .../templates/common/layout-audit-removal.tpl | 47 +++++++++++++++++-- 4 files changed, 46 insertions(+), 9 deletions(-) diff --git a/webui/controller/message/rejectremove.php b/webui/controller/message/rejectremove.php index 9165e567..1e47b8d2 100644 --- a/webui/controller/message/rejectremove.php +++ b/webui/controller/message/rejectremove.php @@ -37,7 +37,7 @@ class ControllerMessageRejectRemove extends Controller { // Shouldn't we ask for a token or something as well? - $db->query("UPDATE " . TABLE_DELETED . " SET deleted=0, date2=?, reason2=? WHERE id=?", [NOW, $this->request->post['reason2'], $id]); + $db->query("UPDATE " . TABLE_DELETED . " SET deleted=0, approver=?, date2=?, reason2=? WHERE id=?", [$this->data['username'], NOW, $this->request->post['reason2'], $id]); syslog(LOG_INFO, $this->data['username'] . " rejected removing message: $id"); $this->render(); diff --git a/webui/model/search/search.php b/webui/model/search/search.php index 7e77340b..1316106e 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -524,7 +524,7 @@ class ModelSearchSearch extends Model { } if(ENABLE_DELETE) { - $s = $this->db->query("SELECT `id` FROM `" . TABLE_DELETED . "` WHERE id IN ($q)", $ids); + $s = $this->db->query("SELECT `id` FROM `" . TABLE_DELETED . "` WHERE deleted=1 AND id IN ($q)", $ids); foreach ($s->rows as $p) { $deleted[$p['id']] = 1; diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index db84830d..1b4a3033 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -391,11 +391,11 @@ var Piler = Piler.poor_mans_keepalive_for_dummy_browsers(); - jQuery.ajax('/index.php?route=message/rejectremove', { + jQuery.ajax('/rejectremove.php', { data: { id: id, confirmed: 1, reason2: reason2 }, type: "POST" }) - .done( function( a ) {}) + .done( function( a ) { location.reload(); }) .fail(function( a, b ) { alert("Problem retrieving XML data:" + b) }); $('#delete-rejected-modal').modal('hide') diff --git a/webui/view/theme/default/templates/common/layout-audit-removal.tpl b/webui/view/theme/default/templates/common/layout-audit-removal.tpl index 8742550d..dd131c75 100644 --- a/webui/view/theme/default/templates/common/layout-audit-removal.tpl +++ b/webui/view/theme/default/templates/common/layout-audit-removal.tpl @@ -43,19 +43,24 @@ - + -