Change data logged to access.log

This commit is contained in:
Retro_Guy 2022-02-09 05:51:20 +00:00
parent d28ba18c47
commit dd36c0e3d3
4 changed files with 13 additions and 3 deletions

View File

@ -10,8 +10,8 @@
include "$file_newsportal";
$logfile=$logdir.'/newsportal.log';
$accessfile=$logdir.'/access.log';
throttle_hits();
write_access_log();
if(isset($_COOKIE['mail_name'])) {
if($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) {
$userfile=$spooldir.'/'.strtolower($_COOKIE['mail_name']).'-articleviews.dat';
@ -58,7 +58,7 @@
$location = $_SERVER['REQUEST_URI'].$_SERVER['REQUEST_STRING'];
$_SESSION['return_page'] = $location.'#'.$id;
file_put_contents($accessfile, "\n".format_log_date()." ".$config_name." ".$group.":".$id, FILE_APPEND);
// file_put_contents($accessfile, "\n".format_log_date()." ".$config_name." ".$group.":".$id, FILE_APPEND);
if($userdata) {
$userdata[$group] = time();
file_put_contents($userfile, serialize($userdata));

View File

@ -565,6 +565,7 @@ function groups_show($gruppen) {
global $gl_age,$frame,$spooldir,$CONFIG,$spoolnews;
if ($gruppen == false) return;
global $file_thread,$text_groups;
write_access_log();
$c = count($gruppen);
$acttype="keins";
echo '<table class="np_groups_table" cellspacing="0"><tr class="np_thread_head"><td width="45px" class="np_thread_head">';
@ -678,7 +679,7 @@ function groups_show($gruppen) {
$groupdisplay.=get_date_interval(date("D, j M Y H:i T",$lastarticleinfo->date));
$groupdisplay.='<table><tr><td>';
$groupdisplay.='<font class="np_last_posted_date">by: ';
$groupdisplay.=create_name_link(mb_decode_mimeheader($lastarticleinfo->name));
$groupdisplay.=create_name_link($lastarticleinfo->name);
$groupdisplay.='</td></tr></table>';
}
$groupdisplay.="\n";
@ -1599,6 +1600,13 @@ function get_user_mail_auth_data($user) {
return false;
}
function write_access_log() {
global $logdir;
$accessfile=$logdir.'/access.log';
$currentPageUrl = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
file_put_contents($accessfile, "\n".format_log_date()." ".$currentPageUrl, FILE_APPEND);
}
function get_data_from_msgid($msgid) {
global $spooldir;
$database = $spooldir.'/articles-overview.db3';

View File

@ -28,6 +28,7 @@
include "$file_newsportal";
throttle_hits();
write_access_log();
if(isset($_COOKIE['mail_name'])) {
if($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) {
$userfile=$spooldir.'/'.strtolower($_COOKIE['mail_name']).'-articleviews.dat';

View File

@ -11,6 +11,7 @@ include "auth.inc";
$logfile=$logdir.'/newsportal.log';
throttle_hits();
write_access_log();
// register parameters
$group=_rawurldecode($_REQUEST["group"]);