From 2dbc016701058c051e51b949b72f6ff774ba8b8b Mon Sep 17 00:00:00 2001
From: x2000habouzit
-
-
+
headers))) {
@@ -60,9 +40,8 @@ if (isset($_GET['type']) && ($_GET['type']=='cancel') && (checkcancel($post->hea
@@ -101,10 +88,10 @@ if (count($newgroups->overview) and count($profile['subscribe'])) {
'._b_('L\'authentification sur le serveur de forums a échoué').'
'; - require_once("include/footer.inc.php"); - exit; - - case "nntpgroups": - echo ""; - echo _b_('Il n\'y a pas de forum sur ce serveur').'
'; - require_once("include/footer.inc.php"); - exit; - - case "nntpspool": - echo "'._b_('Impossible d\'accéder au forum').'
'; - require_once("footer.inc.php"); - exit; - - case "nntpart": - echo "'._b_('Impossible d\'accéder au message. Le message a peut-être été annulé').'
'; - require_once("footer.inc.php"); - exit; - } -} - -?> diff --git a/install.d/format.inc.php b/install.d/format.inc.php index cfd7d6c..1991bec 100644 --- a/install.d/format.inc.php +++ b/install.d/format.inc.php @@ -7,60 +7,12 @@ * Copyright: See COPYING files that comes with this distribution ********************************************************************************/ -/** produces HTML ouput for header section in post.php - * @param $_header STRING name of the header - * @param $_text STRING value of the header - * @param $_spool OBJECT spool object for building references - * @return STRING HTML output - */ - -function formatDisplayHeader($_header,$_text,$_spool) { - switch ($_header) { - case "date": - return formatDate($_text); - - case "followup-to": - case "newsgroups": - $res = ""; - $groups = preg_split("/(\t| )*,(\t| )*/",$_text); - foreach ($groups as $g) { - $res.=''.$g.', '; - } - return substr($res,0, -2); - - case "from": - return formatFrom($_text); - - case "references": - $rsl = ""; - $ndx = 1; - $text=str_replace("><","> <",$_text); - $text=preg_split("/( |\t)/",strtr($text,$_spool->ids)); - $parents=preg_grep("/^\d+$/",$text); - $p=array_pop($parents); - while ($p) { - $rsl .= "group}" - ."&id=$p\">$ndx "; - $_spool->overview[$p]->desc++; - $p = $_spool->overview[$p]->parent; - $ndx++; - } - return $rsl; - - case "x-face": - return '"._b_('Message annulé')."
"; + } else { + $text = ""._b_('Impossible d\'annuler le message')."
"; + } + } else { + $text = "\n\t"._b_('Vous n\'avez pas les permissions pour annuler ce message')."\n
"; + } + break; + + case 'new': + $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",$_REQUEST['body']); + $message = 'From: '.$banana->profile['name']."\n" + ."Newsgroups: ".str_replace(" ","", $_REQUEST['newsgroups'])."\n" + ."Subject: ".$_REQUEST['subject']."\n" + .(isset($banana->profile['org'])?"Organization: ".$banana->profile['org']."\n":"") + .($_REQUEST['followup']!=''?'Followup-To: '.$_REQUEST['followup']."\n":"") + .$banana->custom + ."\n" + .wrap($body, "", $banana->wrap); + if ($banana->nntp->post($message)) { + $text = ""._b_('Message posté')."
"; + } else { + $text = ""._b_('Impossible de poster le message')."
"; + } + break; -if (isset($_REQUEST['action']) && (isset($_REQUEST['type'])) && -(isset($_SESSION['bananapostok'])) && ($_SESSION['bananapostok'])) { - switch ($_REQUEST['type']) { - case 'cancel': - $mid = array_search($id,$spool->ids); - $nntp->group($group); - $post = new BananaPost($nntp,$id); - - if (checkcancel($post->headers)) { - $message = 'From: '.$profile['name']."\n" - ."Newsgroups: $group\n" - ."Subject: cmsg $mid\n" - .$news['customhdr'] - ."Control: cancel $mid\n" - ."\n" - ."Message canceled with Banana"; - $result = $nntp->post($message); - if ($result) { - $spool->delid($id); - $text = ""._b_('Message annulé')."
"; - } else { - $text = ""._b_('Impossible d\'annuler le message')."
"; - } - } else { - $text="\n\t"._b_('Vous n\'avez pas les permissions pour annuler ce message')."\n
"; - } - break; - case 'new': - $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",$_REQUEST['body']); - $message = 'From: '.$profile['name']."\n" - ."Newsgroups: ".str_replace(" ","", $_REQUEST['newsgroups'])."\n" - ."Subject: ".$_REQUEST['subject']."\n" - .(isset($profile['org'])?"Organization: ".$profile['org']."\n":"") - .($_REQUEST['followup']!=''?'Followup-To: ' - .$_REQUEST['followup']."\n":"") - .$news['customhdr'] - ."\n" - .wrap($body,"",$news['wrap']); - $result = $nntp->post($message); - if ($result) { - $text=""._b_('Message posté')."
"; - } else { - $text=""._b_('Impossible de poster le message')."
"; - } - break; - case 'followupok': - $rq=$nntp->group($group); - $post = new BananaPost($nntp,$id); - if ($post) { - $refs = (isset($post->headers['references'])? + case 'followupok': + $rq=$banana->nntp->group($group); + $post = new BananaPost($id); + if ($post) { + $refs = (isset($post->headers['references'])? $post->headers['references']." ":"").$post->headers['message-id']; - } - - $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",$_REQUEST['body']); - $message = 'From: '.$profile['name']."\n" - ."Newsgroups: ".$_REQUEST['newsgroups']."\n" - ."Subject: ".$_REQUEST['subject']."\n" - .(isset($profile['org'])?"Organization: ".$profile['org']."\n":"") - .($_REQUEST['followup']!=''?'Followup-To: ' - .$_REQUEST['followup']."\n":"") - ."References: $refs\n" - .$news['customhdr'] - .$profile['customhdr'] - ."\n" - .wrap($body,"",$news['wrap']); - $result = $nntp->post($message); - if ($result) { - $text=""._b_('Message posté')."
"; - } else { - $text=""._b_('Impossible de poster le message')."
"; - } - break; - } - $_SESSION['bananapostok']=false; - $spool = new BananaSpool($nntp,$group,$profile['display'], $profile['lastnews']); - if (!$spool) error("nntpspool"); -} + } + $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",$_REQUEST['body']); + $message = 'From: '.$banana->profile['name']."\n" + ."Newsgroups: ".$_REQUEST['newsgroups']."\n" + ."Subject: ".$_REQUEST['subject']."\n" + .(isset($banana->profile['org'])?"Organization: ".$banana->profile['org']."\n":"") + .($_REQUEST['followup']!=''?'Followup-To: '.$_REQUEST['followup']."\n":"") + ."References: $refs\n" + .$banana->custom + .$banana->profile['customhdr'] + ."\n" + .wrap($body, "", $banana->wrap); + if ($banana->nntp->post($message)) { + $text = ""._b_('Message posté')."
"; + } else { + $text = ""._b_('Impossible de poster le message')."
"; + } + break; + } + $_SESSION['bananapostok']=false; + $banana->newSpool($group, $banana->profile['display'], $banana->profile['lastnews']); +} ?> -