From 86d26ebcb6e57bc20b64089939136419b8365cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 13 Feb 2011 20:32:35 +0200 Subject: Log unauthenticated HTTP requests. --- HISTORY | 1 + vdradmind.pl | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 0afdc1f..7c93875 100644 --- a/HISTORY +++ b/HISTORY @@ -7,6 +7,7 @@ VDR-Portal: amair 2010-xx-xx: 3.6.x - Updated: Dutch translation (Submitted by Roel Koelewijn). - Updated: Finnish translation (Ville Skyttä). +- Improved: Access logging (Ville Skyttä). 2010-04-10: 3.6.7 - Updated: Italian translation (Submitted by Diego Pierotto). diff --git a/vdradmind.pl b/vdradmind.pl index 8173417..128b114 100755 --- a/vdradmind.pl +++ b/vdradmind.pl @@ -674,6 +674,8 @@ while (true) { } } + my ($http_status, $bytes_transfered); + # authenticate #print("Username: $username / Password: $password\n"); my $checkpass = defined($username) && defined($password); @@ -682,14 +684,14 @@ while (true) { } elsif (($checkpass && $CONFIG{USERNAME_GUEST} eq $username && $CONFIG{PASSWORD_GUEST} eq $password) && $CONFIG{GUEST_ACCOUNT}) { $Guest = 1; } else { - headerNoAuth(); + ($http_status, $bytes_transfered) = headerNoAuth(); + Log(LOG_INFO, "[ACCESS] " . access_log($Client->peerhost, $username, $raw_request, $http_status, $bytes_transfered, $Request, $http_useragent)); close($Client); next; } # serve request $SVDRP = SVDRP->new; - my ($http_status, $bytes_transfered); $MyURL = "." . $Request; if ($Request eq "/vdradmin.pl" || $Request eq "/vdradmin." . $CONFIG{TV_EXT} || $Request eq "/vdradmin." . $CONFIG{REC_EXT}) { $q = CGI->new($Query); -- cgit v1.2.3