diff --git a/Rocksolid_Light/rocksolid/lib/post.inc.php b/Rocksolid_Light/rocksolid/lib/post.inc.php index 1c33680..d90a627 100644 --- a/Rocksolid_Light/rocksolid/lib/post.inc.php +++ b/Rocksolid_Light/rocksolid/lib/post.inc.php @@ -419,7 +419,7 @@ function message_post($subject, $from, $newsgroups, $ref, $body, $encryptthis = global $server, $port, $send_poster_host, $text_error, $CONFIG; global $www_charset, $config_dir, $spooldir; global $msgid_generate, $msgid_fqdn, $rslight_version; - + flush(); $attachment_temp_dir = $spooldir . "/tmp/"; if (! is_dir($attachment_temp_dir)) { @@ -477,7 +477,7 @@ function message_post($subject, $from, $newsgroups, $ref, $body, $encryptthis = fputs($ns, 'Subject: ' . encode_subject($subject) . "\r\n"); // For Synchronet use if (isset($CONFIG['synchronet']) && ($CONFIG['synchronet'] == true)) { - if(!isset($fromname) || trim($fromname) == '') { + if (! isset($fromname) || trim($fromname) == '') { $fromname = 'ALL'; } fputs($ns, 'To: ' . $fromname . "\r\n"); @@ -497,8 +497,21 @@ function message_post($subject, $from, $newsgroups, $ref, $body, $encryptthis = } } } - - fputs($ns, 'From: ' . $from . "\r\n"); + + // Check for custom name/email from user configuration + $user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . $authname . '.config')); + if(trim($user_config['display_name']) == '') { + unset($user_config['display_name']); + } + if(trim($user_config['display_email']) == '') { + unset($user_config['display_email']); + } + if (isset($user_config['display_name']) && isset($user_config['display_email'])) { + fputs($ns, 'From: ' . $user_config['display_name'] .' <' .$user_config['display_email'] . ">\r\n"); + } else { + fputs($ns, 'From: ' . $from . "\r\n"); + } + if ($followupto !== null) { fputs($ns, 'Followup-To: ' . $followupto . "\r\n"); } diff --git a/Rocksolid_Light/rocksolid/post.php b/Rocksolid_Light/rocksolid/post.php index b1d3acd..bca023e 100644 --- a/Rocksolid_Light/rocksolid/post.php +++ b/Rocksolid_Light/rocksolid/post.php @@ -185,7 +185,7 @@ if ($type == "post") { } } // Check that user has not been recently banned - if(!is_file($config_dir.'/users/'.strtolower(trim($name)))) { + if (! is_file($config_dir . '/users/' . strtolower(trim($name)))) { $type = "retry"; $error = $text_error["auth_error"]; $_SESSION['pass'] = false; @@ -272,16 +272,16 @@ if ($type == "post") { } echo '
'; /* - if (isset($_REQUEST['returngroup']) && $_REQUEST['returngroup'] !== '') { - echo 'Your post will appear in ' . group_display_name($_REQUEST['returngroup']) . '
'; - } - if (isset($_SESSION['return_page'])) { - echo ''; - //echo ''; - } else { - echo ''; - } - */ + * if (isset($_REQUEST['returngroup']) && $_REQUEST['returngroup'] !== '') { + * echo 'Your post will appear in ' . group_display_name($_REQUEST['returngroup']) . '
'; + * } + * if (isset($_SESSION['return_page'])) { + * echo ''; + * //echo ''; + * } else { + * echo ''; + * } + */ } else { // article not accepted by the newsserver $type = "retry"; @@ -395,7 +395,7 @@ if ($show == 1) { echo ' or "' . $CONFIG['anonusername'] . '" with no password'; } echo ''.$text_post["message"].' |