* newsportal.php: nntp_open() now checks if the NNTP server is offline before trying to send commands. It bails out with an error if it cannot connection

* english.lang: cleaned up error messages and added more
This commit is contained in:
vga256 2023-07-05 16:02:59 -06:00 committed by Retro_Guy
parent e9a33a1418
commit 18559b6299
2 changed files with 22 additions and 10 deletions

View File

@ -42,22 +42,22 @@ $text_post["name"]="Username:";
$text_post["password"]="Password:";
$text_post["email"]="Your E-Mail:";
$text_post["missing_message"]="You must include a message to post.";
$text_post["missing_email"]="You must include an email address.";
$text_post["missing_email"]="You must include an e-mail address.";
$text_post["missing_name"]="You must include a name or at least an alias.";
$text_post["missing_subject"]="You must include a subject.";
$text_post["button_post"]="Post Article";
$text_post["remember"]="Remember name";
$text_post["message"]="Message";
$text_post["group_head"]="Compose article for ";
$text_post["group_head"]="Compose a new post in ";
$text_post["group_tail"]="";
$text_post["followup_not_allowed"]="You aren't allowed to post to the groups:";
$text_post["message_posted"]="Message posted";
$text_post["message_posted2"]="The message was successfully posted.";
$text_post["button_back"]="Back";
$text_post["button_back2"]="to";
$text_post["error_newsserver"]="The newsserver does not accept the message:";
$text_post["error_newsserver"]="The Message Server rejected the message:";
$text_post["error_readonly"]="The group is write protected";
$text_post["error_wrong_email"]="The email adress is wrong";
$text_post["error_wrong_email"]="Wrong e-mail address.";
$text_post["wrote_prefix"]="";
$text_post["wrote_suffix"]=" wrote:";
$text_post["quote"]="Quote";
@ -67,16 +67,16 @@ $text_post["captchainfo2"]='Enter the correct letters and numbers from the image
$text_error["error:"]='<font color="red">Error:</font>';
$text_error["connection_failed"]="The connection to the Newsserver failed";
$text_error["connection_failed"]="The connection to the Message Server failed";
$text_error["article_not_found"]="<p>The article doesn't exist.</p>";
$text_error["read_access_denied"]="<p>No permission to read!</p>";
$text_error["post_failed"]="Connection failed. Try to reload later.";
$text_error["auth_error"]="Authentication at the Newsserver failed.";
$text_error["auth_error"]="Authentication failed.";
$text_error["spool_error"]="Error in spoolfile. Please reload.";
$text_register["must_register_group"]="You have to be registered to have access to this newsgroup";
$text_register["must_register_post"]="You have to be registrered to post to this newsgroup";
$text_register["no_access_group"]="You don't have access to this newsgroup";
$text_register["no_access_post"]="You are not allowed to post to this newsgroup";
$text_register["must_register_group"]="You have to be registered to have access to this group.";
$text_register["must_register_post"]="You have to be registrered to post to this group.";
$text_register["no_access_group"]="You don't have access to this group.";
$text_register["no_access_post"]="You are not allowed to post to this group.";
?>

View File

@ -42,6 +42,7 @@ $CONFIG = include($config_file);
function nntp_open($nserver=0,$nport=0) {
global $text_error,$CONFIG;
global $server,$port;
// echo "<br>NNTP OPEN<br>";
if(!isset($CONFIG['enable_nntp']) || $CONFIG['enable_nntp'] != true) {
$CONFIG['server_auth_user'] = $CONFIG['remote_auth_user'];
@ -52,6 +53,17 @@ function nntp_open($nserver=0,$nport=0) {
if ($nserver==0) $nserver=$server;
if ($nport==0) $nport=$port;
$ns=@fsockopen($nserver,$nport);
// if the connection to the news server fails, inform the user and stop processing.
if ($ns == false)
{
echo '<center><p>' . $text_error["error:"] . " " . $text_error["connection_failed"] . '.</p>';
echo '<br>';
echo '<p>Please wait a few moments and try again. If you see the same error, notify the owner that their Message Server is offline.</p>';
echo '</center>';
exit(0);
}
$weg=line_read($ns); // kill the first line
if (substr($weg,0,2) != "20") {
echo "<p>".$text_error["error:"].$weg."</p>";