From fe1f5f76a5b5553cf92176488858f2bbd760463b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 8 Feb 2018 12:19:12 +0100 Subject: Update translations --- modules-available/syslog/lang/en/template-tags.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules-available/syslog/lang/en/template-tags.json') diff --git a/modules-available/syslog/lang/en/template-tags.json b/modules-available/syslog/lang/en/template-tags.json index 7dae52d9..1aae1fe9 100644 --- a/modules-available/syslog/lang/en/template-tags.json +++ b/modules-available/syslog/lang/en/template-tags.json @@ -1,11 +1,12 @@ { + "lang_anonDaysDescription": "After how many days should log messages be anonymized? Set to 0 to disable this feature.", + "lang_applyFilter": "Apply Filter", "lang_client": "Client", "lang_clientLog": "Client Log", "lang_details": "Details", "lang_event": "Event", "lang_filter": "Filter", - "lang_go": "Go", "lang_not": "not", - "lang_when": "When", - "lang_applyFilter": "Apply Filter" + "lang_settings": "Settings", + "lang_when": "When" } \ No newline at end of file -- cgit v1.2.3-55-g7522 From f37c95a560f0d2bac96e4b0e650d12691181b876 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 7 Aug 2018 16:48:13 +0200 Subject: [syslog] Add user export feature This will export all rows from tables that log user related content, data, events, helping administrators to conform to DSGVO information requests. Closes #3401 --- modules-available/syslog/api.inc.php | 39 ++++++++++++++++++++++ .../syslog/lang/de/template-tags.json | 4 +++ .../syslog/lang/en/template-tags.json | 4 +++ modules-available/syslog/page.inc.php | 2 +- .../syslog/permissions/permissions.json | 3 ++ modules-available/syslog/templates/heading.html | 39 ++++++++++++++++++++-- 6 files changed, 87 insertions(+), 4 deletions(-) (limited to 'modules-available/syslog/lang/en/template-tags.json') diff --git a/modules-available/syslog/api.inc.php b/modules-available/syslog/api.inc.php index 18c42c31..945f9d09 100644 --- a/modules-available/syslog/api.inc.php +++ b/modules-available/syslog/api.inc.php @@ -1,5 +1,44 @@ Database::simpleQuery("SELECT dateline, logtypeid AS typeid, clientip, description FROM clientlog + WHERE description REGEXP :exp + ORDER BY dateline ASC", ['exp' => $exp])]; + if (Module::get('statistics') !== false) { + $srcs[] = ['res' => Database::simpleQuery("SELECT dateline, typeid, clientip, data AS description FROM statistic + WHERE username = :user + ORDER BY dateline ASC", ['user' => $user])]; + } + echo "# Begin log\n"; + for (;;) { + unset($best); + foreach ($srcs as &$src) { + if (!isset($src['row'])) { + $src['row'] = $src['res']->fetch(PDO::FETCH_ASSOC); + } + if ($src['row'] !== false && (!isset($best) || $src['row']['dateline'] < $best['dateline'])) { + $best =& $src['row']; + } + } + if (!isset($best)) + break; + echo date('Y-m-d H:i:s', $best['dateline']), "\t", $best['typeid'], "\t", $best['clientip'], "\t", $best['description'], "\n"; + $best = null; // so we repopulate on next iteration + } + die("# End log\n"); +} + if (empty($_POST['type'])) die('Missing options.'); $type = mb_strtolower($_POST['type']); diff --git a/modules-available/syslog/lang/de/template-tags.json b/modules-available/syslog/lang/de/template-tags.json index b5c6f8c7..c00d619a 100644 --- a/modules-available/syslog/lang/de/template-tags.json +++ b/modules-available/syslog/lang/de/template-tags.json @@ -5,8 +5,12 @@ "lang_clientLog": "Client Log", "lang_details": "Details", "lang_event": "Ereignis", + "lang_export": "Exportieren", + "lang_exportUserDesc": "Mit dieser Funktion k\u00f6nnen Sie alle in der Datenbank vorhandenen Datens\u00e4tze zu einem bestimmten Benutzer exportieren. Bitte geben Sie den Benutzernamen genau so ein, wie ihn der Nutzer beim Login am Client angeben muss.", "lang_filter": "Filter", "lang_not": "not", "lang_settings": "Einstellungen", + "lang_userExport": "Nutzer-Export", + "lang_userLogin": "Benutzer-Login", "lang_when": "Wann" } \ No newline at end of file diff --git a/modules-available/syslog/lang/en/template-tags.json b/modules-available/syslog/lang/en/template-tags.json index 1aae1fe9..24e9aaa1 100644 --- a/modules-available/syslog/lang/en/template-tags.json +++ b/modules-available/syslog/lang/en/template-tags.json @@ -5,8 +5,12 @@ "lang_clientLog": "Client Log", "lang_details": "Details", "lang_event": "Event", + "lang_export": "Export", + "lang_exportUserDesc": "This exports all data from the database relating to the given user login. Please specify the user name exactly the way they would provide it when logging in on a client.", "lang_filter": "Filter", "lang_not": "not", "lang_settings": "Settings", + "lang_userExport": "User export", + "lang_userLogin": "User login", "lang_when": "When" } \ No newline at end of file diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php index 00c55a3f..6c1a0a16 100644 --- a/modules-available/syslog/page.inc.php +++ b/modules-available/syslog/page.inc.php @@ -31,7 +31,7 @@ class Page_SysLog extends Page protected function doRender() { $data = ['anondays' => Property::get(self::PROP_ANON_DAYS, 0)]; - Permission::addGlobalTags($data['perms'], NULL, ['configure-anonymization']); + Permission::addGlobalTags($data['perms'], NULL, ['configure-anonymization', 'export-user-data']); Render::addTemplate("heading", $data); if (!User::hasPermission("view")) { diff --git a/modules-available/syslog/permissions/permissions.json b/modules-available/syslog/permissions/permissions.json index cabf82f9..1f2373d4 100644 --- a/modules-available/syslog/permissions/permissions.json +++ b/modules-available/syslog/permissions/permissions.json @@ -4,5 +4,8 @@ }, "configure-anonymization": { "location-aware": false + }, + "export-user-data": { + "location-aware": false } } \ No newline at end of file diff --git a/modules-available/syslog/templates/heading.html b/modules-available/syslog/templates/heading.html index 2ab1a848..8dd3d440 100644 --- a/modules-available/syslog/templates/heading.html +++ b/modules-available/syslog/templates/heading.html @@ -1,7 +1,13 @@ \ No newline at end of file -- cgit v1.2.3-55-g7522