diff options
Diffstat (limited to 'modules-available/syslog')
-rw-r--r-- | modules-available/syslog/hooks/statistics/machine-replace.inc.php | 5 | ||||
-rw-r--r-- | modules-available/syslog/page.inc.php | 4 | ||||
-rw-r--r-- | modules-available/syslog/templates/page-syslog.html | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/modules-available/syslog/hooks/statistics/machine-replace.inc.php b/modules-available/syslog/hooks/statistics/machine-replace.inc.php new file mode 100644 index 00000000..6be0dd76 --- /dev/null +++ b/modules-available/syslog/hooks/statistics/machine-replace.inc.php @@ -0,0 +1,5 @@ +<?php + +foreach ($list as $entry) { + Database::exec('UPDATE IGNORE clientlog SET machineuuid = :new WHERE machineuuid = :old AND dateline < :datelimit', $entry); +} diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php index c679877a..153b591f 100644 --- a/modules-available/syslog/page.inc.php +++ b/modules-available/syslog/page.inc.php @@ -55,10 +55,10 @@ class Page_SysLog extends Page else $whereClause .= ' AND '; - $whereClause .= "machineuuid='" . preg_replace('/[^0-9a-zA-Z\-]/', '', Request::get('machineuuid', '', 'string')) . "'"; + $whereClause .= "machineuuid='" . preg_replace('/[^0-9a-zA-Z\-]/', '', Request::get('machineuuid', '', 'string')) . "'"; } $lines = array(); - $paginate = new Paginate("SELECT logid, dateline, logtypeid, clientip, description, extra FROM clientlog $whereClause ORDER BY logid DESC", 50); + $paginate = new Paginate("SELECT logid, dateline, logtypeid, clientip, machineuuid, description, extra FROM clientlog $whereClause ORDER BY logid DESC", 50); $res = $paginate->exec(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { $row['date'] = Util::prettyTime($row['dateline']); diff --git a/modules-available/syslog/templates/page-syslog.html b/modules-available/syslog/templates/page-syslog.html index 8b590038..d4709456 100644 --- a/modules-available/syslog/templates/page-syslog.html +++ b/modules-available/syslog/templates/page-syslog.html @@ -45,7 +45,7 @@ <tr> <td><span class="type-button glyphicon {{icon}}" title="{{logtypeid}}"></span></td> <td class="text-center" nowrap="nowrap">{{date}}</td> - <td class="text-left">{{clientip}}</td> + <td class="text-left"><a href="?do=statistics&uuid={{machineuuid}}">{{clientip}}</a></td> <td>{{description}}</td> <td class="text-center">{{#extra}} <a class="btn btn-default btn-xs" onclick="$('#details-body').html($('#extra-{{logid}}').html())" |