2 /********************************************************************************
3 * post.php : posting page
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
10 require("include/session.inc.php");
11 require("include/encoding.inc.php");
12 require("include/format.inc.php");
13 require("include/config.inc.php");
14 require("include/NetNNTP.inc.php");
15 require("include/post.inc.php");
16 require("include/spool.inc.php");
17 require("include/password.inc.php");
18 require("include/profile.inc.php");
19 require("include/wrapper.inc.php");
21 $profile = getprofile();
22 require($profile['locale']);
24 require("include/header.inc.php");
25 if (isset($_REQUEST['group'])) {
26 $group=htmlentities(strtolower($_REQUEST['group']));
28 if (isset($_REQUEST['id'])) {
29 $id=htmlentities(strtolower($_REQUEST['id']));
36 $mynntp = new nntp($news['server']);
38 echo "<p class=\"error\">\n\t".$locale['error']['connect']."\n</p>";
39 require("include/footer.inc.php");
42 if ($news['user']!="anonymous") {
43 $result = $mynntp->authinfo($news["user"],$news["pass"]);
45 echo "<p class=\"error\">\n\t".$locale['error']['credentials']
47 require("include/footer.inc.php");
52 if (isset($group) && isset($id) && isset($_REQUEST['type']) &&
53 ($_REQUEST['type']=='followup')) {
54 $rq=$mynntp->group($group);
55 $post = new post($mynntp,$id);
57 $subject = (preg_match("/^re:/i",$post->headers
->subject
)?
"":"Re: ")
58 .$post->headers
->subject
;
59 $body = $post->headers
->name
." wrote :\n".wrap($post->body
, ">");
60 if (isset($post->headers
->followup
))
61 $target=$post->headers
->followup
;
63 $target=$post->headers
->newsgroups
;
69 <div
class="<?php echo $css['title']?>">
70 <?php
echo $locale['post']['title'];?
>
78 <form action
="thread.php" method
="POST">
79 <table
class="<?php echo $css['bicol']?>" cellpadding
="0" cellspacing
="0" border
="0">
82 <?php
echo $locale['post']['headers'];?
>
86 <td
class="<?php echo $css['bicoltitre'];?>">
87 <?php
echo $locale['post']['name'];?
>
90 <?php
echo htmlentities($profile['name']); ?
>
94 <td
class="<?php echo $css['bicoltitre'];?>">
95 <?php
echo $locale['post']['subject'];?
>
98 <input type
="text" name
="subject" value
="<?php echo
99 (isset($subject)?$subject:"");?>" />
103 <td
class="<?php echo $css['bicoltitre'];?>">
104 <?php
echo $locale['post']['newsgroups'];?
>
107 <input type
="text" name
="newsgroups" value
="<?php echo
108 (isset($target)?$target:"");?>" />
112 <td
class="<?php echo $css['bicoltitre'];?>">
113 <?php
echo $locale['post']['fu2'];?
>
116 <input type
="text" name
="followup" value
="" />
120 <td
class="<?php echo $css['bicoltitre'];?>">
121 <?php
echo $locale['post']['organization'];?
>
124 <?php
echo $profile['org']; ?
>
129 <?php
echo $locale['post']['body'];?
>
133 <td
class="<?php echo $css['bicolvpadd'];?>" colspan
="2">
134 <textarea name
="body" cols
="90" rows
="10"><?php
echo
135 (isset($body)?
$body:"").($profile['sig']!=''?
"\n\n-- \n"
136 .$profile['sig']:"");?
></textarea
>
140 <td
class="<?php echo $css['bouton']?>" colspan
="2">
142 if (isset($group) && isset($id) && isset($_REQUEST['type'])
143 && ($_REQUEST['type']=='followup')) {
145 <input type
="hidden" name
="type" value
="followupok" />
146 <input type
="hidden" name
="group" value
="<?php echo $group;?>" />
147 <input type
="hidden" name
="id" value
="<?php echo $id;?>" />
151 <input type
="hidden" name
="type" value
="new" />
155 <input type
="submit" name
="action" value
="OK" />
161 require("include/footer.inc.php");