Compare commits

...

6 Commits

6 changed files with 56 additions and 16 deletions

View File

@ -1,5 +1,7 @@
<?php <?php
include "config.inc.php"; include "config.inc.php";
include "../spoolnews/config.inc.php";
include "../spoolnews/newsportal.php";
$title .= ' - Available Newsgroups'; $title .= ' - Available Newsgroups';
include "head.inc"; include "head.inc";
@ -7,9 +9,10 @@ $cache_filename = $spooldir . '/grouplist-cache.txt';
echo '<center>'; echo '<center>';
echo '<h3>List of Available Newsgroups:</h3>'; echo '<h3>List of Available Newsgroups:</h3>';
// Use cache if new enough // Use cache if new enough
if (filemtime($cache_filename) > (time() - 3600)) { // 14400 = 4 hours
// echo file_get_contents($cache_filename); if (filemtime($cache_filename) > (time() - 14400)) {
// exit(); echo file_get_contents($cache_filename);
exit();
} }
ob_start(); ob_start();
@ -17,7 +20,7 @@ echo '<table border="1">';
echo '<tr>'; echo '<tr>';
echo '<th>Group</th>'; echo '<th>Group</th>';
echo '<th>Description</th>'; echo '<th>Description</th>';
// echo '<th>Messages</th>'; echo '<th>Messages</th>';
echo '</tr>'; echo '</tr>';
$menulist = file($config_dir . "menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $menulist = file($config_dir . "menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
@ -42,14 +45,15 @@ foreach ($menulist as $menu) {
} }
} }
} }
ksort($groups_array); ksort($groups_array);
$ns = nntp_open();
foreach ($groups_array as $thisgroup) { foreach ($groups_array as $thisgroup) {
echo '<tr>'; echo '<tr>';
echo '<td>'; echo '<td>';
$group = explode("group=", $thisgroup); $group = explode("group=", $thisgroup);
if (is_file($spooldir . '/' . $group[1] . '-title')) { if (is_file($spooldir . '/' . urldecode($group[1]) . '-title')) {
$title = file_get_contents($spooldir . '/' . $group[1] . '-title'); $title = file_get_contents($spooldir . '/' . urldecode($group[1]) . '-title');
$title = strrchr($title, "\t"); $title = strrchr($title, "\t");
} else { } else {
$title = ''; $title = '';
@ -57,12 +61,22 @@ foreach ($groups_array as $thisgroup) {
echo '<font size=5><a href="/' . $thisgroup . '">' . urldecode($group[1]) . "</a></font><br />\r\n"; echo '<font size=5><a href="/' . $thisgroup . '">' . urldecode($group[1]) . "</a></font><br />\r\n";
echo '</td>'; echo '</td>';
echo '<td>' . $title . '</td>'; echo '<td>' . $title . '</td>';
echo '<td>';
# Check if group exists. Open it if it does
fputs($ns, "group " . urldecode($group[1]) . "\r\n");
$response = line_read($ns);
$messages = explode(' ', $response);
if (strcmp(substr($response, 0, 3), "211") == 0) {
echo "\n" . $messages[1];
}
echo '</td>';
echo '</tr>'; echo '</tr>';
} }
nntp_close($ns);
echo '</table>'; echo '</table>';
echo '<br />';
include "../spoolnews/tail.inc";
echo '</center>'; echo '</center>';
include "tail.inc";
echo '</body></html>'; echo '</body></html>';
file_put_contents($cache_filename, ob_get_contents()); file_put_contents($cache_filename, ob_get_contents());
ob_end_flush(); ob_end_flush();

View File

@ -29,9 +29,6 @@ header("Pragma: cache");
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
?>
<?php
include "config.inc.php"; include "config.inc.php";
include "auth.inc"; include "auth.inc";
include "$file_newsportal"; include "$file_newsportal";
@ -309,19 +306,41 @@ function expire_overboard($cachefile)
function display_threads($threads, $oldest) function display_threads($threads, $oldest)
{ {
global $CONFIG, $thissite, $logfile, $config_name, $snippetlength, $maxdisplay, $prune, $this_overboard; global $CONFIG, $OVERRIDES, $thissite, $logfile, $config_name, $snippetlength, $maxdisplay, $prune, $this_overboard;
echo '<table cellspacing="0" width="100%" class="np_results_table">'; echo '<table cellspacing="0" width="100%" class="np_results_table">';
if (! isset($threads)) { if (! isset($threads)) {
$threads = (object) []; $threads = (object) [];
} else { } else {
krsort($threads); krsort($threads);
} }
// Get registered user settings
if (isset($_COOKIE['mail_name'])) {
if ($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) {
$userfile = $spooldir . '/' . strtolower($_COOKIE['mail_name']) . '-articleviews.dat';
$user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . strtolower($_COOKIE['mail_name']) . '.config'));
}
if (! isset($user_config['hide_unsub'])) {
if (isset($OVERRIDES['hide_unsub'])) {
$user_config['hide_unsub'] = $OVERRIDES['hide_unsub'];
} else {
$user_config['hide_unsub'] = 'hide';
}
}
}
$results = 0; $results = 0;
foreach ($threads as $key => $value) { foreach ($threads as $key => $value) {
$target = $this_overboard['msgids'][$value]; $target = $this_overboard['msgids'][$value];
$checkgroup = $target['newsgroup'];
if (! isset($target['msgid'])) { if (! isset($target['msgid'])) {
$target = get_data_from_msgid($value); $target = get_data_from_msgid($value);
} }
if (!isset($userdata[$checkgroup])) {
if (isset($user_config['hide_unsub']) && $user_config['hide_unsub'] == 'hide') {
continue;
}
}
if ($target['date'] < $oldest) { if ($target['date'] < $oldest) {
continue; continue;
} }

View File

@ -492,8 +492,7 @@ function quoten() {
value="<?php echo $text_post["quote"]?>" value="<?php echo $text_post["quote"]?>"
onclick="quoten(); this.style.visibility= 'hidden';"> onclick="quoten(); this.style.visibility= 'hidden';">
&nbsp; &nbsp;
<input type="checkbox" name="abspeichern" value="ja" checked>
<?php echo $text_post["remember"];?>
<?php } ?> <?php } ?>
&nbsp; &nbsp;
<input type="file" name="photo" id="fileSelect" value="fileSelect" <input type="file" name="photo" id="fileSelect" value="fileSelect"

View File

@ -11,6 +11,8 @@ if (isset($_POST['command']) && $_POST['command'] == 'Logout') {
} }
$_SESSION = array(); $_SESSION = array();
session_destroy(); session_destroy();
unset($_COOKIE['mail_name']);
setcookie('mail_name', '', -1, '/');
$logmeout = true; $logmeout = true;
} else { } else {
$logmeout = false; $logmeout = false;

View File

@ -17,7 +17,7 @@
// Where these scripts reside and messages are created: (end with '/') // Where these scripts reside and messages are created: (end with '/')
// You must have write access to this directory // You must have write access to this directory
$workpath = "/home/paris/BBS/nocem/"; $workpath = "/home/user/nocem/";
$domain = "your_domain"; $domain = "your_domain";
$organization = "your_organization"; $organization = "your_organization";
@ -43,6 +43,9 @@ $spamgroup = "alt.test,misc.test";
$hierarchies = "the alt.* and de.* hierarchies"; $hierarchies = "the alt.* and de.* hierarchies";
// $hierarchies = "ALL hierarchies"; // $hierarchies = "ALL hierarchies";
// Add group to Followup-To header. Leave blank for no header
$followup_to = "news.admin.net-abuse.usenet";
// EDIT THE BELOW LINES to reflect your specific needs // EDIT THE BELOW LINES to reflect your specific needs
// NOTE: You may comment out any lines below you do not want // NOTE: You may comment out any lines below you do not want

View File

@ -57,6 +57,9 @@ if($count < 2) {
} }
fwrite($header_file, "Message-ID: <$thishash@$domain>\n"); fwrite($header_file, "Message-ID: <$thishash@$domain>\n");
if(isset($followup_to)) {
fwrite($header_file, "Followup-To: $followup_to\n");
}
fwrite($header_file, "From: $from\n"); fwrite($header_file, "From: $from\n");
fwrite($header_file, "Newsgroups: $spamgroup\n"); fwrite($header_file, "Newsgroups: $spamgroup\n");
fwrite($header_file, "Subject: @@NCM NoCeM notice $thishash spam/hide ($count $article)\n"); fwrite($header_file, "Subject: @@NCM NoCeM notice $thishash spam/hide ($count $article)\n");