+ function action_cancelArticle($group, $id)
+ {
+ $this->_newSpool($group, $this->profile['display'], $this->profile['lastnews']);
+ $this->_newPost($id);
+ $mid = array_search($id, $this->spool->ids);
+
+ if (!$this->post->checkcancel()) {
+ return '<p class="error">'._b_('Vous n\'avez pas les permissions pour annuler ce message').'</p>';
+ }
+ $msg = 'From: '.$this->profile['name']."\n"
+ . "Newsgroups: $group\n"
+ . "Subject: cmsg $mid\n"
+ . $this->custom
+ . "Control: cancel $mid\n"
+ . "\n"
+ . "Message canceled with Banana";
+ if ($this->nntp->post($msg)) {
+ $this->spool->delid($id);
+ $this->nntp->quit();
+ header("Location: ?group=$group&first=$id");
+ } else {
+ return '<p class="error">'._b_('Impossible d\'annuler le message').'</p>';
+ }
+ }
+
+ function action_newFup($group, $id = -1)
+ {
+ $subject = $body = '';
+ $target = $group;
+
+ if ($id > 0) {
+ $this->nntp->group($group);
+ $this->_newPost($id);
+ if ($this->post) {
+ $subject = preg_replace("/^re\s*:\s*/i", 'Re: ', $this->post->headers['subject']);
+ $body = $this->post->name." "._b_("a écrit")." :\n".wrap($this->post->body, "> ");
+ $target = isset($this->post->headers['followup-to']) ? $this->post->headers['followup-to'] : $this->post->headers['newsgroups'];
+ }
+ }
+
+ $this->nntp->quit();
+
+ $cuts = displayshortcuts();
+ $html = '<h1>'._b_('Nouveau message').'</h1>'.$cuts;
+ $html .= '<form action="?group='.$group.'" method="post">';
+ $html .= '<table class="bicol" cellpadding="0" cellspacing="0">';
+ $html .= '<tr><th colspan="2">'._b_('En-têtes').'</th></tr>';
+ $html .= '<tr><td>'._b_('Nom').'</td><td>'.htmlentities($this->profile['name']).'</td></tr>';
+ $html .= '<tr><td>'._b_('Sujet').'</td><td><input type="text" name="subject" value="'.htmlentities($subject).'" size="60" /></td></tr>';
+ $html .= '<tr><td>'._b_('Forums').'</td><td><input type="text" name="newsgroups" value="'.htmlentities($target).'" size="60" /></td></tr>';
+ $html .= '<tr><td>'._b_('Suivi à').'</td><td><input type="text" name="followup" value="" size="60" /></td></tr>';
+ $html .= '<tr><td>'._b_('Organisation').'</td><td>'.$this->profile['org'].'</td></tr>';
+ $html .= '<tr><th colspan="2">'._b_('Corps').'</th></tr>';
+ $html .= '<tr><td colspan="2"><textarea name="body" cols="74" rows="16">'
+ .htmlentities($body).($this->profile['sig'] ? "\n\n-- \n".htmlentities($this->profile['sig']) : '').'</textarea></td></th>';
+ $html .= '<tr><td colspan="2">';
+ if ($id > 0) {
+ $html .= '<input type="hidden" name="artid" value="'.$id.'" />';
+ }
+ $html .= '<input type="hidden" name="action" value="new" />';
+ $html .= '<input type="submit" /></td></tr>';
+ $html .= '</table></form>';
+
+ return $html.$cuts;
+ }
+
+ function action_doFup($group, $artid = -1)
+ {
+ $this->_newSpool($group, $this->profile['display'], $this->profile['lastnews']);
+ $body = preg_replace("/\n\.[ \t\r]*\n/m", "\n..\n", $_POST['body']);
+ $msg = 'From: '.$this->profile['name']."\n"
+ . "Newsgroups: ".$_POST['newsgroups']."\n"
+ . "Subject: ".$_POST['subject']."\n"
+ . (empty($this->profile['org']) ? '' : "Organization: {$this->profile['org']}\n")
+ . (empty($_POST['followup']) ? '' : 'Followup-To: '.$_POST['followup']."\n");
+
+ if ($artid != -1) {
+ require_once("include/post.inc.php");
+ $post = new BananaPost($artid);
+ $refs = ( isset($post->headers['references']) ? $post->headers['references']." " : "" );
+ $msg .= "References: $refs{$post->headers['message-id']}\n";
+ }
+
+ $msg .= $this->custom.$this->profile['customhdr']."\n".wrap($body, "", $this->wrap);
+
+ if ($this->nntp->post($msg)) {
+ header("Location: ?group=$group".($artid==-1 ? '' : "&first=$artid"));
+ } else {
+ return "<p class=\"error\">"._b_('Impossible de poster le message')."</p>".$this->action_showThread($group, $artid);
+ }
+ }
+