From 67bd3501856774b34b3c94e6cb17faa2def3802f Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 9 May 2012 10:36:24 -0400 Subject: Fix line endings... autocrlf is your friend. --- config/squid-reverse/squid_monitor.php | 324 ++++++++++++------------ config/squid-reverse/squid_monitor_data.php | 378 ++++++++++++++-------------- 2 files changed, 351 insertions(+), 351 deletions(-) diff --git a/config/squid-reverse/squid_monitor.php b/config/squid-reverse/squid_monitor.php index d8f5240b..da293358 100644 --- a/config/squid-reverse/squid_monitor.php +++ b/config/squid-reverse/squid_monitor.php @@ -1,162 +1,162 @@ - - - - - - - - -

- - - - - - - - - -
-
- - - - - - - - - - - -
Max lines: - -
- - Max. lines to be displayed. - -
String filter: - -
- - Enter the string filter: eg. username or ip addr or url. - -
-
- - - - - - - - -
- - - - - - - -
-
- - - - - - - - -
- - - - - - - -
-
-
- - - - - + + + + + + + + +

+ + + + + + + + + +
+
+ + + + + + + + + + + +
Max lines: + +
+ + Max. lines to be displayed. + +
String filter: + +
+ + Enter the string filter: eg. username or ip addr or url. + +
+
+ + + + + + + + +
+ + + + + + + +
+
+ + + + + + + + +
+ + + + + + + +
+
+
+ + + + + diff --git a/config/squid-reverse/squid_monitor_data.php b/config/squid-reverse/squid_monitor_data.php index 0e9d900a..12d2a34a 100644 --- a/config/squid-reverse/squid_monitor_data.php +++ b/config/squid-reverse/squid_monitor_data.php @@ -1,189 +1,189 @@ -"; - } - return $cont; -} - - -// Show Squid Logs -function showSquid() { - // Define log file - $squid_log='/var/squid/logs/access.log'; - - echo "\n"; - echo "".gettext("Date")."\n"; - echo "".gettext("IP")."\n"; - echo "".gettext("Status")."\n"; - echo "".gettext("Address")."\n"; - echo "".gettext("User")."\n"; - echo "".gettext("Destination")."\n"; - echo "\n"; - - // Get Data from form post - $lines = $_POST['maxlines']; - $filter = $_POST['strfilter']; - - - // Get logs based in filter expression - if($filter != "") { - exec("tail -r -n $lines $squid_log | php -q parser_squid_log.php | grep -i ". escapeshellarg(htmlspecialchars($filter)), $logarr); - } - else { - exec("tail -r -n $lines $squid_log | php -q parser_squid_log.php", $logarr); - } - - // Print lines - foreach ($logarr as $logent) { - // Split line by space delimiter - $logline = preg_split("/\s+/", $logent); - - // Apply date format to first line - //$logline[0] = date("d.m.Y H:i:s",$logline[0]); - - // Word wrap the URL - $logline[7] = htmlentities($logline[7]); - $logline[7] = html_autowrap($logline[7]); - - // Remove /(slash) in destination row - $logline_dest = preg_split("/\//", $logline[9]); - - // Apply filter and color - // Need validate special chars - if ($filter != "") - $logline = preg_replace("/$filter/i","$filter",$logline); - - - echo "\n"; - echo "{$logline[0]} {$logline[1]}\n"; - echo "{$logline[3]}\n"; - echo "{$logline[4]}\n"; - echo "{$logline[7]}\n"; - echo "{$logline[8]}\n"; - echo "{$logline_dest[1]}\n"; - echo "\n"; - } -} - -// Show SquidGuard Logs -function showSGuard() { - // Define log file - $sguard_log='/var/squidGuard/log/block.log'; - - echo "\n"; - echo "".gettext("Date-Time")."\n"; - echo "".gettext("ACL")."\n"; - echo "".gettext("Address")."\n"; - echo "".gettext("Host")."\n"; - echo "".gettext("User")."\n"; - echo "\n"; - - // Get Data from form post - $lines = $_POST['maxlines']; - $filter = $_POST['strfilter']; - - // Get logs based in filter expression - if($filter != "") { - exec("tail -r -n $lines $sguard_log | grep -i ". escapeshellarg(htmlspecialchars($filter)), $logarr); - } - else { - exec("tail -r -n $lines $sguard_log", $logarr); - } - - - // Print lines - foreach ($logarr as $logent) { - // Split line by space delimiter - $logline = preg_split("/\s+/", $logent); - - // Apply time format - $logline[0] = date("d.m.Y", strtotime($logline[0])); - - // Word wrap the URL - $logline[4] = htmlentities($logline[4]); - $logline[4] = html_autowrap($logline[4]); - - - // Apply filter color - // Need validate special chars - if ($filter != "") - $logline = preg_replace("/$filter/","$filter",$logline); - - echo "\n"; - echo "{$logline[0]} {$logline[1]}\n"; - echo "{$logline[3]}\n"; - echo "{$logline[4]}\n"; - echo "{$logline[5]}\n"; - echo "{$logline[6]}\n"; - echo "\n"; - } -} - -?> +"; + } + return $cont; +} + + +// Show Squid Logs +function showSquid() { + // Define log file + $squid_log='/var/squid/logs/access.log'; + + echo "\n"; + echo "".gettext("Date")."\n"; + echo "".gettext("IP")."\n"; + echo "".gettext("Status")."\n"; + echo "".gettext("Address")."\n"; + echo "".gettext("User")."\n"; + echo "".gettext("Destination")."\n"; + echo "\n"; + + // Get Data from form post + $lines = $_POST['maxlines']; + $filter = $_POST['strfilter']; + + + // Get logs based in filter expression + if($filter != "") { + exec("tail -r -n $lines $squid_log | php -q parser_squid_log.php | grep -i ". escapeshellarg(htmlspecialchars($filter)), $logarr); + } + else { + exec("tail -r -n $lines $squid_log | php -q parser_squid_log.php", $logarr); + } + + // Print lines + foreach ($logarr as $logent) { + // Split line by space delimiter + $logline = preg_split("/\s+/", $logent); + + // Apply date format to first line + //$logline[0] = date("d.m.Y H:i:s",$logline[0]); + + // Word wrap the URL + $logline[7] = htmlentities($logline[7]); + $logline[7] = html_autowrap($logline[7]); + + // Remove /(slash) in destination row + $logline_dest = preg_split("/\//", $logline[9]); + + // Apply filter and color + // Need validate special chars + if ($filter != "") + $logline = preg_replace("/$filter/i","$filter",$logline); + + + echo "\n"; + echo "{$logline[0]} {$logline[1]}\n"; + echo "{$logline[3]}\n"; + echo "{$logline[4]}\n"; + echo "{$logline[7]}\n"; + echo "{$logline[8]}\n"; + echo "{$logline_dest[1]}\n"; + echo "\n"; + } +} + +// Show SquidGuard Logs +function showSGuard() { + // Define log file + $sguard_log='/var/squidGuard/log/block.log'; + + echo "\n"; + echo "".gettext("Date-Time")."\n"; + echo "".gettext("ACL")."\n"; + echo "".gettext("Address")."\n"; + echo "".gettext("Host")."\n"; + echo "".gettext("User")."\n"; + echo "\n"; + + // Get Data from form post + $lines = $_POST['maxlines']; + $filter = $_POST['strfilter']; + + // Get logs based in filter expression + if($filter != "") { + exec("tail -r -n $lines $sguard_log | grep -i ". escapeshellarg(htmlspecialchars($filter)), $logarr); + } + else { + exec("tail -r -n $lines $sguard_log", $logarr); + } + + + // Print lines + foreach ($logarr as $logent) { + // Split line by space delimiter + $logline = preg_split("/\s+/", $logent); + + // Apply time format + $logline[0] = date("d.m.Y", strtotime($logline[0])); + + // Word wrap the URL + $logline[4] = htmlentities($logline[4]); + $logline[4] = html_autowrap($logline[4]); + + + // Apply filter color + // Need validate special chars + if ($filter != "") + $logline = preg_replace("/$filter/","$filter",$logline); + + echo "\n"; + echo "{$logline[0]} {$logline[1]}\n"; + echo "{$logline[3]}\n"; + echo "{$logline[4]}\n"; + echo "{$logline[5]}\n"; + echo "{$logline[6]}\n"; + echo "\n"; + } +} + +?> -- cgit v1.2.3