Add override option to disable adding X-Rslight-* headers to posts.

This commit is contained in:
Retro_Guy 2024-05-08 01:59:27 -07:00
parent 256dfcb07d
commit c97f2865eb
2 changed files with 12 additions and 4 deletions

View File

@ -519,10 +519,14 @@ function message_post($subject, $from, $newsgroups, $ref, $body, $encryptthis =
fputs($ns, 'Followup-To: ' . $followupto . "\r\n");
}
fputs($ns, 'Newsgroups: ' . $newsgroups . "\r\n");
$sitekey = password_hash($CONFIG['thissitekey'] . $msgid, PASSWORD_DEFAULT);
$posting_user = hash('sha1', $from . $CONFIG['thissitekey'] . $_SERVER['HTTP_HOST']);
fputs($ns, 'X-Rslight-Site: ' . $sitekey . "\r\n");
fputs($ns, 'X-Rslight-Posting-User: ' . $posting_user . "\r\n");
if (! isset($OVERRIDES['disable_rslight_headers']) || $OVERRIDES['disable_rslight_headers'] != true) {
$sitekey = password_hash($CONFIG['thissitekey'] . $msgid, PASSWORD_DEFAULT);
$posting_user = hash('sha1', $from . $CONFIG['thissitekey'] . $_SERVER['HTTP_HOST']);
fputs($ns, 'X-Rslight-Site: ' . $sitekey . "\r\n");
fputs($ns, 'X-Rslight-Posting-User: ' . $posting_user . "\r\n");
}
if (isset($encryptthis)) {
fputs($ns, 'X-Rslight-To: ' . $encryptto . "\r\n");
$CONFIG['postfooter'] = "";

View File

@ -61,6 +61,10 @@ return [
// Disable New Articles link on groups page
'overboard_disable_new_link' => false,
// Disable adding 'X-Rslight-*' headers to
// outgoing messages
'disable_rslight_headers' => false,
// Set User-Agent: string (default = 'Rocksolid Light')
// Set to '' for no User-Agent: header
'user_agent' => 'Rocksolid Light',