<?php
+/********************************************************************************
+* post.php : posting page
+* ----------
+*
+* This file is part of the banana distribution
+* Copyright: See COPYING files that comes with this distribution
+********************************************************************************/
+
require("include/session.inc.php");
require("include/encoding.inc.php");
require("include/format.inc.php");
require("include/password.inc.php");
require("include/profile.inc.php");
require("include/wrapper.inc.php");
+require("include/error.inc.php");
$profile = getprofile();
require($profile['locale']);
require("include/header.inc.php");
-$group=htmlentities(strtolower($_REQUEST['group']));
-$id=htmlentities(strtolower($_REQUEST['id']));
+if (isset($_REQUEST['group'])) {
+ $group=htmlentities(strtolower($_REQUEST['group']));
+}
+if (isset($_REQUEST['id'])) {
+ $id=htmlentities(strtolower($_REQUEST['id']));
+}
if (isset($group)) {
$target = $group;
}
-$mynntp = new nntp($news['server']);
-if (!$mynntp) {
- echo "<p class=\"error\">\n\t".$locale['error']['connect']."\n</p>";
- require("include/footer.inc.php");
- exit;
-}
+$nntp = new nntp($news['server']);
+if (!$nntp) error("nntpsock");
if ($news['user']!="anonymous") {
- $result = $mynntp->authinfo($news["user"],$news["pass"]);
- if (!$result) {
- echo "<p class=\"error\">\n\t".$locale['error']['credentials']
- ."\n</p>";
- require("include/footer.inc.php");
- exit;
- }
+ $result = $nntp->authinfo($news["user"],$news["pass"]);
+ if (!$result) error("nntpauth");
}
if (isset($group) && isset($id) && isset($_REQUEST['type']) &&
($_REQUEST['type']=='followup')) {
- $rq=$mynntp->group($group);
- $post = new post($mynntp,$id);
+ $rq=$nntp->group($group);
+ $post = new post($nntp,$id);
if ($post) {
$subject = (preg_match("/^re:/i",$post->headers->subject)?"":"Re: ")
.$post->headers->subject;
}
}
-$mynntp->quit();
+$nntp->quit();
?>
-<div class="title">
+<div class="<?php echo $css['title']?>">
<?php echo $locale['post']['title'];?>
</div>
<?php
?>
<form action="thread.php" method="POST">
-<table class="bicol" cellpadding="0" cellspacing="0" border="0">
+<table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0" border="0">
<tr>
<th colspan="2">
<?php echo $locale['post']['headers'];?>
</th>
</tr>
<tr>
- <td>
+ <td class="<?php echo $css['bicoltitre'];?>">
<?php echo $locale['post']['name'];?>
</td>
<td>
</td>
</tr>
<tr>
- <td>
+ <td class="<?php echo $css['bicoltitre'];?>">
<?php echo $locale['post']['subject'];?>
</td>
<td>
</td>
</tr>
<tr>
- <td>
+ <td class="<?php echo $css['bicoltitre'];?>">
<?php echo $locale['post']['newsgroups'];?>
</td>
<td>
</td>
</tr>
<tr>
- <td>
+ <td class="<?php echo $css['bicoltitre'];?>">
<?php echo $locale['post']['fu2'];?>
</td>
<td>
</td>
</tr>
<tr>
- <td>
+ <td class="<?php echo $css['bicoltitre'];?>">
<?php echo $locale['post']['organization'];?>
</td>
<td>
</th>
</tr>
<tr>
- <td colspan="2">
+ <td class="<?php echo $css['bicolvpadd'];?>" colspan="2">
<textarea name="body" cols="90" rows="10"><?php echo
(isset($body)?$body:"").($profile['sig']!=''?"\n\n-- \n"
.$profile['sig']:"");?></textarea>
</td>
</tr>
<tr>
- <td class="bouton" colspan="2">
+ <td class="<?php echo $css['bouton']?>" colspan="2">
<?php
if (isset($group) && isset($id) && isset($_REQUEST['type'])
&& ($_REQUEST['type']=='followup')) {
?>
<input type="hidden" name="type" value="followupok" />
<input type="hidden" name="group" value="<?php echo $group;?>" />
- <input type="hidden" name="id" value="<?php echo $id;?> " />
+ <input type="hidden" name="id" value="<?php echo $id;?>" />
<?php
} else {
?>