Merge branch 'devel'
This commit is contained in:
commit
0623901dd5
|
@ -8,34 +8,6 @@ if (basename(getcwd()) == 'mods') {
|
|||
include ($rootdir . 'common/config.inc.php');
|
||||
|
||||
$CONFIG = include $config_file;
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
if (navigator.cookieEnabled)
|
||||
document.cookie = "tzo="+ (- new Date().getTimezoneOffset())+"; path=/";
|
||||
</script>
|
||||
<style>
|
||||
#loading_indicator {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
border: 10px solid grey;
|
||||
border-radius: 50%;
|
||||
border-top: 10px solid blue;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
animation: spinIndicator 1s linear infinite;
|
||||
}
|
||||
@keyframes spinIndicator {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
|
||||
$menulist = file($config_dir . "menu.conf", FILE_IGNORE_NEW_LINES);
|
||||
$linklist = file($config_dir . "links.conf", FILE_IGNORE_NEW_LINES);
|
||||
|
@ -62,20 +34,8 @@ if ((isset($_SESSION['theme'])) && file_exists($rootdir . 'common/themes/' . $_S
|
|||
} else {
|
||||
$header_image = $rootdir . 'common/images/rocksolidlight.png';
|
||||
}
|
||||
echo '</head><body textcolor="black" bgcolor="white">';
|
||||
echo '<div id = "loading_indicator"> </div>';
|
||||
?>
|
||||
|
||||
<script>
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if(document.readyState === "complete"){
|
||||
document.getElementById("loading_indicator").style.display ="none";
|
||||
document.querySelector("body").style.visibility = "visible";
|
||||
}
|
||||
});
|
||||
document.querySelector("body").style.visibility = "hidden";
|
||||
document.getElementById("loading_indicator").style.visibility = "visible";
|
||||
</script>
|
||||
?>
|
||||
|
||||
<table class="np_header_bar_top" width="100%" valign="middle">
|
||||
<tr>
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.9.141
|
||||
0.9.142
|
||||
|
|
|
@ -563,7 +563,7 @@ function show_header_short($head, $group, $local_poster = false)
|
|||
<p id="<?php echo $head->id; ?>"
|
||||
style="position: absolute; z-index: -9999;"><?php echo htmlspecialchars($head->id); ?></p>
|
||||
|
||||
<a href="#"
|
||||
<a href="<?php echo $sitelink . '/' . $config_name . '/article-flat.php?id=' . $head->number . '&group=' . urlencode($group) . '#' . $head->number; ?>"
|
||||
onclick="CopyToClipboard('<?php echo $head->id; ?>');return false;"
|
||||
style="text-decoration: none" title="Copy message-id to clipboard"><i>copy
|
||||
mid</i></a>
|
||||
|
@ -571,7 +571,7 @@ function show_header_short($head, $group, $local_poster = false)
|
|||
<p id="<?php echo $head->number . 'copy'; ?>"
|
||||
style="position: absolute; z-index: -9999;"><?php echo $sitelink . '/' . $config_name . '/article-flat.php?id=' . $head->number . '&group=' . urlencode($group) . '#' . $head->number; ?></p>
|
||||
|
||||
<a href="#"
|
||||
<a href="<?php echo $sitelink . '/' . $config_name . '/article-flat.php?id=' . $head->number . '&group=' . urlencode($group) . '#' . $head->number; ?>"
|
||||
onclick="CopyToClipboard('<?php echo $head->number . 'copy'; ?>');return false;"
|
||||
style="text-decoration: none" title="Copy article link to clipboard"><i>copy
|
||||
link</i></a>
|
||||
|
@ -837,6 +837,9 @@ function message_show($group, $id, $attachment = 0, $article_data = false, $maxl
|
|||
return "no-archive";
|
||||
}
|
||||
|
||||
// Any header checks to display notice in article display
|
||||
$notice = display_header_notice($head);
|
||||
|
||||
if(isset($head->content_type[0])) {
|
||||
if(!strpos($head->content_type[0], "/")) {
|
||||
echo '<hr><p class=np_ob_posted_date>(message #' . $head->number . ' not displayed - malformed header)</p><hr>';
|
||||
|
@ -845,6 +848,7 @@ function message_show($group, $id, $attachment = 0, $article_data = false, $maxl
|
|||
}
|
||||
if (($head->content_type[$attachment] == "text/plain") && ($attachment == 0)) {
|
||||
show_header($head, $group, $local_poster);
|
||||
echo $notice;
|
||||
// X-Face
|
||||
if (($face = display_full_headers($head->number, $group, $head->name, $head->from, true)) && ($OVERRIDES['disable_xface'] != true)) {
|
||||
$pngfile = '../tmp/face-' . hash('ripemd160', $face);
|
||||
|
@ -1042,3 +1046,13 @@ function articleflat_pageselect($group, $id, $article_count, $first)
|
|||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function display_header_notice($head) {
|
||||
$notice = false;
|
||||
if(stripos($head->subject, "Re: ") === 0) {
|
||||
if(!isset($head->references)) {
|
||||
$notice = '<hr><p class=np_ob_posted_date>(article missing references header)</p><hr>';
|
||||
}
|
||||
}
|
||||
return $notice;
|
||||
}
|
|
@ -1826,7 +1826,8 @@ function get_search_snippet($body, $content_type = '', $content_transfer_encodin
|
|||
$body = quoted_printable_decode($body);
|
||||
}
|
||||
if ($content_type !== '') {
|
||||
$mysnippet = recode_charset($body, $content_type, "utf8");
|
||||
$content_type = explode(';', $content_type);
|
||||
$mysnippet = recode_charset($body, $content_type[0]);
|
||||
} else {
|
||||
$mysnippet = $body;
|
||||
}
|
||||
|
|
|
@ -2,12 +2,21 @@
|
|||
include "config.inc.php";
|
||||
include ("$file_newsportal");
|
||||
include $config_dir . "/scripts/rslight-lib.php";
|
||||
$lockfile = $lockdir . '/rslight-nntp-ssl.lock';
|
||||
if (file_exists($config_dir . "/nntp.disable")) {
|
||||
clearstatcache(true, $config_dir . "/nntp.disable");
|
||||
$parent_pid = file_get_contents($lockdir . '/rslight-nntp.lock', IGNORE_NEW_LINES);
|
||||
$parent_pid = file_get_contents($lockfile);
|
||||
posix_kill($parent_pid, SIGTERM);
|
||||
exit();
|
||||
}
|
||||
if (file_exists($config_dir . "/nntp.reload")) {
|
||||
clearstatcache(true, $config_dir . "/nntp.reload");
|
||||
$parent_pid = file_get_contents($lockfile);
|
||||
posix_kill($parent_pid, SIGTERM);
|
||||
unlink($config_dir . "/nntp.reload");
|
||||
unlink($lockfile);
|
||||
sleep(5);
|
||||
}
|
||||
/**
|
||||
* Listens for requests and forks on each connection
|
||||
*/
|
||||
|
@ -42,9 +51,8 @@
|
|||
function server_loop($address, $port)
|
||||
{
|
||||
GLOBAL $__server_listening;
|
||||
GLOBAL $CONFIG, $logdir, $lockdir, $webserver_uid, $webserver_gid, $installed_path, $config_path, $groupconfig, $workpath, $path, $spooldir, $ssldir, $nntp_group, $auth_ok;
|
||||
GLOBAL $CONFIG, $logdir, $lockfile, $webserver_uid, $webserver_gid, $installed_path, $config_path, $groupconfig, $workpath, $path, $spooldir, $ssldir, $nntp_group, $auth_ok;
|
||||
$logfile = $logdir . '/nntp.log';
|
||||
$lockfile = $lockdir . '/rslight-nntp-ssl.lock';
|
||||
$pid = file_get_contents($lockfile);
|
||||
if (posix_getsid($pid) === false || ! is_file($lockfile)) {
|
||||
print "Starting Rocksolid Light NNTP Server...\n";
|
||||
|
|
|
@ -2,12 +2,23 @@
|
|||
include "config.inc.php";
|
||||
include ("$file_newsportal");
|
||||
include $config_dir . "/scripts/rslight-lib.php";
|
||||
$lockfile = $lockdir . '/rslight-nntp.lock';
|
||||
if (file_exists($config_dir . "/nntp.disable")) {
|
||||
clearstatcache(true, $config_dir . "/nntp.disable");
|
||||
$parent_pid = file_get_contents($lockdir . '/rslight-nntp.lock', IGNORE_NEW_LINES);
|
||||
$parent_pid = file_get_contents($lockfile);
|
||||
posix_kill($parent_pid, SIGTERM);
|
||||
exit();
|
||||
}
|
||||
if (file_exists($config_dir . "/nntp.reload")) {
|
||||
clearstatcache(true, $config_dir . "/nntp.reload");
|
||||
$parent_pid = file_get_contents($lockfile);
|
||||
posix_kill($parent_pid, SIGTERM);
|
||||
if (!is_numeric($CONFIG['local_ssl_port'])) {
|
||||
unlink($config_dir . "/nntp.reload");
|
||||
}
|
||||
unlink($lockfile);
|
||||
sleep(5);
|
||||
}
|
||||
/**
|
||||
* Listens for requests and forks on each connection
|
||||
*/
|
||||
|
@ -42,9 +53,8 @@
|
|||
function server_loop($address, $port)
|
||||
{
|
||||
GLOBAL $__server_listening;
|
||||
GLOBAL $CONFIG, $logdir, $lockdir, $webserver_uid, $webserver_gid, $installed_path, $config_path, $groupconfig, $workpath, $path, $spooldir, $nntp_group, $auth_ok;
|
||||
GLOBAL $CONFIG, $logdir, $lockfile, $webserver_uid, $webserver_gid, $installed_path, $config_path, $groupconfig, $workpath, $path, $spooldir, $nntp_group, $auth_ok;
|
||||
$logfile = $logdir . '/nntp.log';
|
||||
$lockfile = $lockdir . '/rslight-nntp.lock';
|
||||
$pid = file_get_contents($lockfile);
|
||||
if (posix_getsid($pid) === false || ! is_file($lockfile)) {
|
||||
print "Starting Rocksolid Light NNTP Server...\n";
|
||||
|
|
|
@ -34,11 +34,6 @@ function interact($msgsock, $use_crypto = false)
|
|||
$msg = "";
|
||||
set_time_limit(30);
|
||||
$buf = fgets($msgsock, 2048);
|
||||
if (file_exists($config_dir . "/nntp.disable")) {
|
||||
$parent_pid = file_get_contents($lockdir . '/rslight-nntp.lock', IGNORE_NEW_LINES);
|
||||
posix_kill($parent_pid, SIGTERM);
|
||||
exit();
|
||||
}
|
||||
if ($buf === false) {
|
||||
// file_put_contents($logfile, "\n".format_log_date()." socket read failed: reason: " . socket_strerror(socket_last_error($msgsock)), FILE_APPEND);
|
||||
break;
|
||||
|
@ -1250,6 +1245,7 @@ function insert_article($section, $nntp_group, $filename, $subject_i, $from_i, $
|
|||
} else {
|
||||
$this_snippet = get_search_snippet($body);
|
||||
}
|
||||
unlink($tmp_file);
|
||||
} else {
|
||||
rename($tmp_file, $tradspool_out_file);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue