summaryrefslogtreecommitdiffstats
path: root/modules/syslog.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2013-11-27 19:23:45 +0100
committerSimon Rettberg2013-11-27 19:23:45 +0100
commit2370dbbbddfcbee9e69e1133d78b9992118682bc (patch)
treea235d8e76c2f26473566f69191dc1f5d2b27a987 /modules/syslog.inc.php
parentAdd gzip compression to output (diff)
downloadslx-admin-2370dbbbddfcbee9e69e1133d78b9992118682bc.tar.gz
slx-admin-2370dbbbddfcbee9e69e1133d78b9992118682bc.tar.xz
slx-admin-2370dbbbddfcbee9e69e1133d78b9992118682bc.zip
Added client log feature/view
Diffstat (limited to 'modules/syslog.inc.php')
-rw-r--r--modules/syslog.inc.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/syslog.inc.php b/modules/syslog.inc.php
new file mode 100644
index 00000000..ccbf1b32
--- /dev/null
+++ b/modules/syslog.inc.php
@@ -0,0 +1,22 @@
+<?php
+
+User::load();
+
+if (!User::isLoggedIn()) {
+ Util::redirect('?do=main');
+}
+
+function render_module()
+{
+ Render::setTitle('Client Log');
+
+ $lines = array();
+ $res = Database::simpleQuery('SELECT logid, dateline, logtypeid, clientip, description, extra FROM clientlog ORDER BY logid DESC LIMIT 200');
+ while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ $row['date'] = date('d.m.Y H:i', $row['dateline']);
+ $lines[] = $row;
+ }
+
+ Render::addTemplate('page-syslog', array('token' => Session::get('token'), 'list' => $lines));
+}
+