From d00bdd107b758a0b0b432bbae15566fc1607ea8f Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Wed, 4 Oct 2023 06:26:37 -0700 Subject: [PATCH] Add post logging in post.php per request. --- Rocksolid_Light/rocksolid/post.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Rocksolid_Light/rocksolid/post.php b/Rocksolid_Light/rocksolid/post.php index e5e8a3f..16d7ed4 100644 --- a/Rocksolid_Light/rocksolid/post.php +++ b/Rocksolid_Light/rocksolid/post.php @@ -25,6 +25,13 @@ session_start(); include "config.inc.php"; $CONFIG = include ($config_file); +$logfile = $logdir . '/post.log'; + +// This will log user post info (group and username) +$enable_post_log = false; +if ($OVERRIDES['enable_post_log'] > 0) { + $enable_post_log = $OVERRIDES['enable_post_log']; +} @$fieldnamedecrypt = $_REQUEST['fielddecrypt']; // @$newsgroups=$_REQUEST["newsgroups"]; @@ -219,6 +226,10 @@ if ($type == "post") { echo 'Please wait ' . round($wait) . ' minutes before posting again.
'; } } + // Post logging + if ($enable_post_log) { + file_put_contents($logfile, "\n" . format_log_date() . " Post in: " . $returngroup[0] . " by " . $name, FILE_APPEND); + } // echo '

'.$text_post["button_back"].' '.$text_post["button_back2"].' '.group_display_name($returngroup[0]).'

'; if (isset($_REQUEST['returngroup']) && $_REQUEST['returngroup'] !== '') { echo '

Your post will appear in ' . group_display_name($_REQUEST['returngroup']) . '

';