From 5621952f6878f1f5d2f3e368c047ad88b8f88588 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 5 Oct 2017 00:43:30 +0200 Subject: [PATCH] login: save user access details to last.log Mainly to check time of last successful login, with ip address and browser to help debugging client issues (matching earlier data in forum columns users.lastontime, users.lastip, users.useragent). --- auth.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auth.inc.php b/auth.inc.php index b20331a..b8026f9 100644 --- a/auth.inc.php +++ b/auth.inc.php @@ -24,6 +24,10 @@ function login($inuser, $inpass = NULL) if (function_exists('apache_note')) apache_note('user', $inuser); + if ($log = @fopen("$userdir/last.log", 'w')) { + fwrite($log, "{$_SERVER['REMOTE_ADDR']} {$_SERVER['HTTP_USER_AGENT']}\n"); + } + return [ 'name' => $inuser, 'admin' => file_exists("$userdir/.admin"), -- 2.30.0