Add post logging in post.php per request.

This commit is contained in:
Retro_Guy 2023-10-04 06:26:37 -07:00
parent 88b761fce3
commit d00bdd107b
1 changed files with 11 additions and 0 deletions

View File

@ -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.<br />';
}
}
// Post logging
if ($enable_post_log) {
file_put_contents($logfile, "\n" . format_log_date() . " Post in: " . $returngroup[0] . " by " . $name, FILE_APPEND);
}
// echo '<p><a href="'.$file_thread.'?group='.urlencode($returngroup[0]).'">'.$text_post["button_back"].'</a> '.$text_post["button_back2"].' '.group_display_name($returngroup[0]).'</p>';
if (isset($_REQUEST['returngroup']) && $_REQUEST['returngroup'] !== '') {
echo '<p><a href="' . $file_thread . '?group=' . $_REQUEST['returngroup'] . '">Your post will appear in ' . group_display_name($_REQUEST['returngroup']) . '</a></p>';