X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=post.php;h=466b22defbbb57302978cca4a89725de5e7b6e67;hb=b9ea5b300f115e6f9d592eb4f794273ec983f1f3;hp=81450d8dd79756a0c690cfa7492ec9c5ab88793d;hpb=4ee663c543dbaba4b6dac36e4e5d01c1e3695789;p=banana.git diff --git a/post.php b/post.php index 81450d8..466b22d 100644 --- a/post.php +++ b/post.php @@ -7,69 +7,35 @@ * Copyright: See COPYING files that comes with this distribution ********************************************************************************/ -require_once("include/session.inc.php"); -require_once("include/encoding.inc.php"); -require_once("include/format.inc.php"); -require_once("include/config.inc.php"); -require_once("include/NetNNTP.inc.php"); -require_once("include/post.inc.php"); -require_once("include/spool.inc.php"); -require_once("include/password.inc.php"); -require_once("include/profile.inc.php"); -require_once("include/wrapper.inc.php"); -require_once("include/error.inc.php"); - -$profile = getprofile(); -require_once($profile['locale']); - +require_once("include/banana.inc.php"); require_once("include/header.inc.php"); + if (isset($_REQUEST['group'])) { - $group=htmlentities(strtolower($_REQUEST['group'])); + $group = htmlentities(strtolower($_REQUEST['group'])); } if (isset($_REQUEST['id'])) { - $id=htmlentities(strtolower($_REQUEST['id'])); + $id = htmlentities(strtolower($_REQUEST['id'])); } if (isset($group)) { - $target = $group; -} - -$nntp = new nntp($news['server']); -if (!$nntp) error("nntpsock"); -if ($news['user']!="anonymous") { - $result = $nntp->authinfo($news["user"],$news["pass"]); - if (!$result) error("nntpauth"); + $target = $group; } -if (isset($group) && isset($id) && isset($_REQUEST['type']) && - ($_REQUEST['type']=='followup')) { - $rq=$nntp->group($group); - $post = new NNTPPost($nntp,$id); - if ($post) { - $subject = (preg_match("/^re:/i",$post->headers->subject)?"":"Re: ") - .$post->headers->subject; - if ($profile['dropsig']) { - $cutoff=strpos($post->body,"\n-- \n"); - if ($cutoff) { - $quotetext = substr($post->body,0,strpos($post->body,"\n-- \n")); - } else { - $quotetext = $post->body; - } - } else { - $quotetext = $post->body; - } - $body = $post->headers->name." wrote :\n".wrap($quotetext, "> "); - if (isset($post->headers->followup)) - $target=$post->headers->followup; - else - $target=$post->headers->newsgroups; - } +if (isset($group) && isset($id) && isset($_REQUEST['type']) && ($_REQUEST['type']=='followup')) { + $rq = $banana->nntp->group($group); + $banana->newPost($id); + $body = ''; + if ($banana->post) { + $subject = (preg_match("/^re\s*:\s*/i", $banana->post->headers['subject']) ? '' : 'Re: ').$banana->post->headers['subject']; + $body = $banana->post->name." wrote :\n".wrap($banana->post->body, "> "); + $target = isset($banana->post->headers['followup-to']) ? $banana->post->headers['followup-to'] : $banana->post->headers['newsgroups']; + } } -$nntp->quit(); +$banana->nntp->quit(); ?>

- +

" cellpadding="0" cellspacing="0" border="0"> - + - + - + profile['name']); ?> - + - " /> + - + - " /> + - + @@ -120,22 +84,23 @@ displayshortcuts(); - + - + profile['org']; ?> - + - +