diff options
author | Simon Rettberg | 2013-11-27 19:23:45 +0100 |
---|---|---|
committer | Simon Rettberg | 2013-11-27 19:23:45 +0100 |
commit | 2370dbbbddfcbee9e69e1133d78b9992118682bc (patch) | |
tree | a235d8e76c2f26473566f69191dc1f5d2b27a987 /modules | |
parent | Add gzip compression to output (diff) | |
download | slx-admin-2370dbbbddfcbee9e69e1133d78b9992118682bc.tar.gz slx-admin-2370dbbbddfcbee9e69e1133d78b9992118682bc.tar.xz slx-admin-2370dbbbddfcbee9e69e1133d78b9992118682bc.zip |
Added client log feature/view
Diffstat (limited to 'modules')
-rw-r--r-- | modules/syslog.inc.php | 22 |
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)); +} + |