From a8c0ce02da5ce003150aa75d18f9360f29650581 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Mon, 3 May 2021 09:21:59 +0200 Subject: #949 Fix ogagent.log parser Webconsole parses ogagent.log searching an IP without terminator character. Thus, it takes entries with the selected IP and with IPs that start as the selected IP. For example, if it searches for 10.1.30.10, it shows entries of 10.1.30.10, 10.1.30.100, 10.1.30.101... Fix ogagent.log parser to only show entries of the selected IP. --- admin/WebConsole/principal/configuraciones.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'admin/WebConsole') diff --git a/admin/WebConsole/principal/configuraciones.php b/admin/WebConsole/principal/configuraciones.php index 19ecff7d..fca880ab 100644 --- a/admin/WebConsole/principal/configuraciones.php +++ b/admin/WebConsole/principal/configuraciones.php @@ -356,7 +356,7 @@ function datos_sesiones($cmd, $idordenador) } if ($ip) { foreach (file(LOG_FILE) as $line) { - if (strstr($line, "ip=$ip")) { + if (strstr($line, "ip=$ip,")) { $fields = preg_split("/[:,=]/", rtrim($line, ". \t\n\r\0\x0B")); $date_time = str_replace("T", " ", $fields[0]) . ":" . $fields[1] . ":" . preg_replace("/\+.*$/", "", $fields[2]); -- cgit v1.2.3-18-g5258