summaryrefslogtreecommitdiffstats
path: root/modules/syslog
diff options
context:
space:
mode:
Diffstat (limited to 'modules/syslog')
-rw-r--r--modules/syslog/config.json4
-rw-r--r--modules/syslog/lang/de/module.json4
-rw-r--r--modules/syslog/lang/de/templates/page-syslog.json10
-rw-r--r--modules/syslog/lang/en/module.json11
-rw-r--r--modules/syslog/lang/en/templates/page-syslog.json10
-rw-r--r--modules/syslog/lang/pt/module.json11
-rw-r--r--modules/syslog/page.inc.php94
-rw-r--r--modules/syslog/templates/page-syslog.html58
8 files changed, 0 insertions, 202 deletions
diff --git a/modules/syslog/config.json b/modules/syslog/config.json
deleted file mode 100644
index 650ab2fe..00000000
--- a/modules/syslog/config.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "category":"main.status",
- "enabled":"true"
-}
diff --git a/modules/syslog/lang/de/module.json b/modules/syslog/lang/de/module.json
deleted file mode 100644
index b9e8de49..00000000
--- a/modules/syslog/lang/de/module.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "module_name": "Client-Log",
- "page_title": "Lognachrichten gebooteter Clients"
-}
diff --git a/modules/syslog/lang/de/templates/page-syslog.json b/modules/syslog/lang/de/templates/page-syslog.json
deleted file mode 100644
index 49e94602..00000000
--- a/modules/syslog/lang/de/templates/page-syslog.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "lang_client": "Client",
- "lang_clientLog": "Client Log",
- "lang_details": "Details",
- "lang_event": "Ereignis",
- "lang_filter": "Filter",
- "lang_go": "Go",
- "lang_not": "not",
- "lang_when": "Wann"
-} \ No newline at end of file
diff --git a/modules/syslog/lang/en/module.json b/modules/syslog/lang/en/module.json
deleted file mode 100644
index 70107d9c..00000000
--- a/modules/syslog/lang/en/module.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "lang_client": "Client",
- "lang_clientLog": "Client Log",
- "lang_details": "Details",
- "lang_event": "Event",
- "lang_filter": "Filter",
- "lang_go": "go",
- "lang_not": "no",
- "lang_when": "When",
- "module_name": "Server Log"
-} \ No newline at end of file
diff --git a/modules/syslog/lang/en/templates/page-syslog.json b/modules/syslog/lang/en/templates/page-syslog.json
deleted file mode 100644
index 71f61693..00000000
--- a/modules/syslog/lang/en/templates/page-syslog.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "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"
-} \ No newline at end of file
diff --git a/modules/syslog/lang/pt/module.json b/modules/syslog/lang/pt/module.json
deleted file mode 100644
index 0f7c5356..00000000
--- a/modules/syslog/lang/pt/module.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "lang_client": "Cliente",
- "lang_clientLog": "Log dos Clientes",
- "lang_details": "Detalhes",
- "lang_event": "Evento",
- "lang_filter": "Filtro",
- "lang_go": "Ir",
- "lang_not": "n\u00e3o",
- "lang_when": "Quando",
- "module_name": "Log do Servidor"
-} \ No newline at end of file
diff --git a/modules/syslog/page.inc.php b/modules/syslog/page.inc.php
deleted file mode 100644
index 43a9bd28..00000000
--- a/modules/syslog/page.inc.php
+++ /dev/null
@@ -1,94 +0,0 @@
-<?php
-
-class Page_SysLog extends Page
-{
-
- protected function doPreprocess()
- {
- User::load();
-
- if (!User::isLoggedIn()) {
- Message::addError('no-permission');
- Util::redirect('?do=Main');
- }
- }
-
- protected function doRender()
- {
- Render::setTitle('Client Log');
- Render::addScriptBottom('bootstrap-tagsinput.min');
-
- if (isset($_GET['filter'])) {
- $filter = $_GET['filter'];
- $not = isset($_GET['not']) ? 'NOT' : '';
- } elseif (isset($_POST['filter'])) {
- $filter = $_POST['filter'];
- $not = isset($_POST['not']) ? 'NOT' : '';
- Session::set('log_filter', $filter);
- Session::set('log_not', $not);
- Session::save();
- } else {
- $filter = Session::get('log_filter');
- $not = Session::get('log_not') ? 'NOT' : '';
- }
- if (!empty($filter)) {
- $filterList = explode(',', $filter);
- $whereClause = array();
- foreach ($filterList as $filterItem) {
- $filterItem = preg_replace('/[^a-z0-9_\-]/', '', trim($filterItem));
- if (empty($filterItem) || in_array($filterItem, $whereClause)) continue;
- $whereClause[] = "'$filterItem'";
- }
- if (!empty($whereClause)) $whereClause = ' WHERE logtypeid ' . $not . ' IN (' . implode(', ', $whereClause) . ')';
- }
- if (!isset($whereClause) || empty($whereClause)) $whereClause = '';
- if (Request::get('ip')) {
- if (empty($whereClause))
- $whereClause .= ' WHERE ';
- else
- $whereClause .= ' AND ';
- $whereClause .= "clientip LIKE '" . preg_replace('/[^0-9\.\:]/', '', Request::get('ip')) . "%'";
- }
-
- $today = date('d.m.Y');
- $yesterday = date('d.m.Y', time() - 86400);
- $lines = array();
- $paginate = new Paginate("SELECT logid, dateline, logtypeid, clientip, description, extra FROM clientlog $whereClause ORDER BY logid DESC", 50);
- $res = $paginate->exec();
- while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
- $day = date('d.m.Y', $row['dateline']);
- if ($day === $today) {
- $day = Dictionary::translate('today');
- } elseif ($day === $yesterday) {
- $day = Dictionary::translate('yesterday');
- }
- $row['date'] = $day . date(' H:i', $row['dateline']);
- $row['icon'] = $this->eventToIconName($row['logtypeid']);
- $lines[] = $row;
- }
-
- $paginate->render('page-syslog', array(
- 'filter' => $filter,
- 'not' => $not,
- 'list' => $lines
- ));
- }
-
- private function eventToIconName($event)
- {
- switch ($event) {
- case 'session-open':
- return 'glyphicon-log-in';
- case 'session-close':
- return 'glyphicon-log-out';
- case 'partition-swap':
- return 'glyphicon-info-sign';
- case 'partition-temp':
- case 'smartctl-realloc':
- return 'glyphicon-exclamation-sign';
- default:
- return 'glyphicon-minus';
- }
- }
-
-}
diff --git a/modules/syslog/templates/page-syslog.html b/modules/syslog/templates/page-syslog.html
deleted file mode 100644
index 98e94291..00000000
--- a/modules/syslog/templates/page-syslog.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<h1>{{lang_clientLog}}</h1>
-<form method="post" action="?do=SysLog">
- <input type="hidden" name="token" value="{{token}}">
- <div class="input-group">
- <span class="input-group-addon">{{lang_filter}}</span>
- <input id="filterstring" type="text" placeholder="id" value="{{filter}}" name="filter" data-role="tagsinput" />
- <span class="input-group-addon">
- <input type="checkbox" name="not" {{#not}}checked="checked"{{/not}}> {{lang_not}}
- </span>
- <span class="input-group-btn">
- <button class="btn btn-default" type="submit">{{lang_go}}</button>
- </span>
- </div>
-</form>
-{{{pagenav}}}
-<table class="table table-striped table-condensed">
- <thead>
- <th width="1"></th>
- <th>{{lang_when}}</th>
- <th>{{lang_client}}</th>
- <th>{{lang_event}}</th>
- <th width="1">{{lang_details}}</th>
- </thead>
- <tbody>
- {{#list}}
- <tr>
- <td><span class="glyphicon {{icon}}" title="{{logtypeid}}" onclick="$('#filterstring').tagsinput('add', '{{logtypeid}}')"></span></td>
- <td class="text-right" nowrap="nowrap">{{date}}</td>
- <td>{{clientip}}</td>
- <td>{{description}}</td>
- <td>{{#extra}}
- <a class="btn btn-default btn-xs pull-left" onclick="$('#details-body').html($('#extra-{{logid}}').html())" data-toggle="modal" data-target="#myModal">&raquo;</a>
- <div class="hidden" id="extra-{{logid}}">{{extra}}</div>
- {{/extra}}</td>
- </tr>
- {{/list}}
- </tbody>
-</table>
-{{{pagenav}}}
-
-<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
- <h4 class="modal-title" id="myModalLabel">{{lang_details}}</h4>
- </div>
- <div class="modal-body">
- <pre id="details-body"></pre>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
- </div>
- </div>
- </div>
-</div>
-
-