From 734c493dc1e416ee188ad121033b7856e8259816 Mon Sep 17 00:00:00 2001
From: Udo Walter
Date: Thu, 18 Jan 2018 17:54:13 +0100
Subject: [statistics] added permissions to view client logs; removed unused
query arguments from Paginate::exec (caused an error if query arguments that
are actually used in the query are passed to Paginate::exec)
---
modules-available/syslog/templates/heading.html | 1 +
1 file changed, 1 insertion(+)
create mode 100644 modules-available/syslog/templates/heading.html
(limited to 'modules-available/syslog/templates/heading.html')
diff --git a/modules-available/syslog/templates/heading.html b/modules-available/syslog/templates/heading.html
new file mode 100644
index 00000000..d6790a21
--- /dev/null
+++ b/modules-available/syslog/templates/heading.html
@@ -0,0 +1 @@
+
{{lang_clientLog}}
\ No newline at end of file
--
cgit v1.2.3-55-g7522
From 2a8858e17ef441a22526e8aedf5262e7e065d8d6 Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Tue, 13 Feb 2018 16:30:49 +0100
Subject: [syslog] Permission checks when saving anonymization days
---
modules-available/syslog/lang/de/permissions.json | 3 +-
modules-available/syslog/lang/en/permissions.json | 3 +-
modules-available/syslog/page.inc.php | 7 +++--
.../syslog/permissions/permissions.json | 3 ++
modules-available/syslog/templates/heading.html | 36 +++++++++++++++++++++-
.../syslog/templates/page-syslog.html | 26 ----------------
6 files changed, 47 insertions(+), 31 deletions(-)
(limited to 'modules-available/syslog/templates/heading.html')
diff --git a/modules-available/syslog/lang/de/permissions.json b/modules-available/syslog/lang/de/permissions.json
index 0cd05451..dcd96ae1 100644
--- a/modules-available/syslog/lang/de/permissions.json
+++ b/modules-available/syslog/lang/de/permissions.json
@@ -1,3 +1,4 @@
{
- "view": "Client Log anschauen."
+ "configure-anonymization": "Einstellen, nach wie vielen Tagen die Nutzernamen in den Logs entfernt werden.",
+ "view": "Client Log anschauen."
}
\ No newline at end of file
diff --git a/modules-available/syslog/lang/en/permissions.json b/modules-available/syslog/lang/en/permissions.json
index 497e199e..26ea4448 100644
--- a/modules-available/syslog/lang/en/permissions.json
+++ b/modules-available/syslog/lang/en/permissions.json
@@ -1,3 +1,4 @@
{
- "view": "View client log."
+ "configure-anonymization": "Configure after how many days any usernames will be removed from log files.",
+ "view": "View client log."
}
\ No newline at end of file
diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php
index a26ed9be..3a7513b5 100644
--- a/modules-available/syslog/page.inc.php
+++ b/modules-available/syslog/page.inc.php
@@ -14,7 +14,9 @@ class Page_SysLog extends Page
Message::addError('main.no-permission');
Util::redirect('?do=Main');
}
+
if (($days = Request::post('anondays', false, 'int')) !== false) {
+ User::assertPermission('configure-anonymization', NULL,'?do=syslog');
if ($days < 0 || $days > 180) {
Message::addError('anon-days-out-of-range', $days);
} else {
@@ -27,7 +29,9 @@ class Page_SysLog extends Page
protected function doRender()
{
- Render::addTemplate("heading");
+ $data = ['anondays' => Property::get(self::PROP_ANON_DAYS, 0)];
+ Permission::addGlobalTags($data['perms'], NULL, ['configure-anonymization']);
+ Render::addTemplate("heading", $data);
if (!User::hasPermission("view")) {
Message::addError('main.no-permission');
@@ -104,7 +108,6 @@ class Page_SysLog extends Page
'list' => $lines,
'types' => json_encode(array_values($types)),
'machineuuid' => Request::get('machineuuid'),
- 'anondays' => Property::get(self::PROP_ANON_DAYS, 0),
));
}
diff --git a/modules-available/syslog/permissions/permissions.json b/modules-available/syslog/permissions/permissions.json
index fcf530c5..cabf82f9 100644
--- a/modules-available/syslog/permissions/permissions.json
+++ b/modules-available/syslog/permissions/permissions.json
@@ -1,5 +1,8 @@
{
"view": {
"location-aware": true
+ },
+ "configure-anonymization": {
+ "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 d6790a21..2ab1a848 100644
--- a/modules-available/syslog/templates/heading.html
+++ b/modules-available/syslog/templates/heading.html
@@ -1 +1,35 @@
-
{{lang_clientLog}}
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
{{lang_clientLog}}
+
\ No newline at end of file
diff --git a/modules-available/syslog/templates/page-syslog.html b/modules-available/syslog/templates/page-syslog.html
index 7ab81067..9d05d434 100644
--- a/modules-available/syslog/templates/page-syslog.html
+++ b/modules-available/syslog/templates/page-syslog.html
@@ -1,6 +1,3 @@
-