';
if ($found == 1) {
- $poster = address_decode($lastarticleinfo['name'], "nowhere");
- $lastarticleinfo['from'] = $poster[0]['mailbox'] . "@" . $poster[0]['host'];
- if (isset($poster[0]['personal'])) {
- $lastarticleinfo['name'] = $poster[0]['personal'];
+ $fromline = address_decode(headerDecode($lastarticleinfo['name']), "nowhere");
+ if (! isset($fromline[0]["host"]))
+ $fromline[0]["host"] = "";
+ $name_from = $fromline[0]["mailbox"] . "@" . $fromline[0]["host"];
+ if (! isset($fromline[0]["personal"])) {
+ $poster_name = $fromline[0]["mailbox"];
} else {
- $lastarticleinfo['name'] = $poster[0]['mailbox'];
+ $poster_name = $fromline[0]["personal"];
}
- $fromoutput[0] = $poster[0]['mailbox'] . "@" . $poster[0]['host'];
+ if (trim($poster_name) == '') {
+ $fromoutput = explode("<", html_entity_decode($c->name));
+ if (strlen($fromoutput[0]) < 1) {
+ $poster_name = $fromoutput[1];
+ } else {
+ $poster_name = $fromoutput[0];
+ }
+ }
+ $lastarticleinfo['name'] = $poster_name;
+
$groupdisplay .= get_date_interval(date("D, j M Y H:i T", $lastarticleinfo['date']));
$groupdisplay .= '
';
$groupdisplay .= 'by: ';
- $groupdisplay .= create_name_link(mb_decode_mimeheader(html_entity_decode($lastarticleinfo['name'])), $lastarticleinfo['from']);
+
+ $groupdisplay .= create_name_link($lastarticleinfo['name'], $name_from);
$groupdisplay .= ' |
';
} else {
unset($lastarticleinfo);
@@ -1323,10 +1340,14 @@ function verify_logged_in($name) {
function set_user_logged_in_cookies($name, $keys) {
- global $debug_log;
+ global $debug_log, $CONFIG;
$name = trim($name);
$name_lc = strtolower($name);
+ if($name == $CONFIG['anonusername']) {
+ return false;
+ }
+
if( !get_user_config($name_lc, 'encryptionkey')) {
$key = openssl_random_pseudo_bytes(44);
set_user_config($name_lc, 'encryptionkey', base64_encode($key));
@@ -1351,6 +1372,7 @@ function set_user_logged_in_cookies($name, $keys) {
document.cookie = "pkey="+pkey+"; max-age="+name_expire+"; path=/";
getMessage();
- exit();
- }
- $dbh->exec("CREATE TABLE IF NOT EXISTS threads(
- id INTEGER PRIMARY KEY,
- headers TEXT,
- unique (headers))");
- return ($dbh);
-}
-
function history_db_open($database, $table = 'history')
{
try {
diff --git a/Rocksolid_Light/rocksolid/overboard.php b/Rocksolid_Light/rocksolid/overboard.php
index f070154..9badc95 100644
--- a/Rocksolid_Light/rocksolid/overboard.php
+++ b/Rocksolid_Light/rocksolid/overboard.php
@@ -61,6 +61,11 @@ if (disable_page_by_user_agent($client_device, "bot", "Overboard")) {
$CONFIG = include ($config_file);
$logfile = $logdir . '/overboard.log';
+$cookie_mail_name = $_COOKIE['mail_name'];
+if(isset($_COOKIE['mail_name']) && $_COOKIE['mail_name'] == $CONFIG['anonusername']) {
+ unset($cookie_mail_name);
+}
+
# How many days old should articles be displayed?
if (isset($_GET['thisgroup'])) {
$article_age = 30;
@@ -106,10 +111,10 @@ if (isset($_GET['thisgroup'])) {
$grouplist = array();
$grouplist[0] = _rawurldecode(_rawurldecode($_GET['thisgroup']));
$cachefile = $spooldir . "/" . $grouplist[0] . "-overboard.dat";
- 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($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'));
$userdata[$grouplist[0]] = time();
file_put_contents($userfile, serialize($userdata));
}
@@ -119,8 +124,8 @@ if (isset($_GET['thisgroup'])) {
}
// Determine default view style
-if (isset($_COOKIE['mail_name'])) {
- if ($user_obstyle = get_config_file_value($config_dir . '/userconfig/' . strtolower($_COOKIE['mail_name']), 'obstyle')) {
+if (isset($cookie_mail_name)) {
+ if ($user_obstyle = get_config_file_value($config_dir . '/userconfig/' . strtolower($cookie_mail_name), 'obstyle')) {
$_SESSION['obstyle'] = $user_obstyle;
}
}
@@ -134,8 +139,8 @@ if (! isset($_SESSION['obstyle'])) {
$_SESSION['obstyle'] = 'articles';
}
}
-if (isset($_COOKIE['mail_name'])) {
- save_config_value($config_dir . '/userconfig/' . strtolower($_COOKIE['mail_name']), 'obstyle', $_SESSION['obstyle'], true);
+if (isset($cookie_mail_name)) {
+ save_config_value($config_dir . '/userconfig/' . strtolower($cookie_mail_name), 'obstyle', $_SESSION['obstyle'], true);
}
show_overboard_header($grouplist);
@@ -268,10 +273,10 @@ function display_threads($threads, $oldest)
}
// Get registered user settings
$newonly = false;
- if (isset($_COOKIE['mail_name'])) {
- if ($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) {
- $user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . strtolower($_COOKIE['mail_name']) . '.config'));
- $userfile = $spooldir . '/' . strtolower($_COOKIE['mail_name']) . '-blocked_posters.dat';
+ if (isset($cookie_mail_name)) {
+ if ($userdata = get_user_mail_auth_data($cookie_mail_name)) {
+ $user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . strtolower($cookie_mail_name) . '.config'));
+ $userfile = $spooldir . '/' . strtolower($cookie_mail_name) . '-blocked_posters.dat';
if (file_exists($userfile)) {
$blocked_user_config = unserialize(file_get_contents($userfile));
} else {
@@ -448,12 +453,12 @@ function display_flat($threads, $oldest)
}
// Get registered user settings
$newonly = false;
- 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($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'));
}
- $userfile = $spooldir . '/' . strtolower($_COOKIE['mail_name']) . '-blocked_posters.dat';
+ $userfile = $spooldir . '/' . strtolower($cookie_mail_name) . '-blocked_posters.dat';
if (file_exists($userfile)) {
$blocked_user_config = unserialize(file_get_contents($userfile));
} else {
diff --git a/Rocksolid_Light/rocksolid/post.php b/Rocksolid_Light/rocksolid/post.php
index f7d060b..80d8840 100644
--- a/Rocksolid_Light/rocksolid/post.php
+++ b/Rocksolid_Light/rocksolid/post.php
@@ -222,13 +222,15 @@ if ($type == "post") {
} else {
$_SESSION['pass'] = true;
$logged_in = true;
- set_user_logged_in_cookies($name, $keys);
- file_put_contents($auth_log, "\n" . logging_prefix() . " SET AUTH COOKIES for: " . $name, FILE_APPEND);
+ if (set_user_logged_in_cookies($name, $keys)) {
+ file_put_contents($auth_log, "\n" . logging_prefix() . " SET AUTH COOKIES for: " . $name, FILE_APPEND);
+ }
}
} else {
// Update cookie times to stay logged in
- set_user_logged_in_cookies($name, $keys);
- file_put_contents($auth_log, "\n" . logging_prefix() . " UPDATED AUTH COOKIES for: " . $name, FILE_APPEND);
+ if (set_user_logged_in_cookies($name, $keys)) {
+ file_put_contents($auth_log, "\n" . logging_prefix() . " UPDATED AUTH COOKIES for: " . $name, FILE_APPEND);
+ }
}
}
// Check that user has not been recently banned
diff --git a/Rocksolid_Light/rocksolid/search.php b/Rocksolid_Light/rocksolid/search.php
index 03aa65c..3dbe71c 100644
--- a/Rocksolid_Light/rocksolid/search.php
+++ b/Rocksolid_Light/rocksolid/search.php
@@ -116,7 +116,6 @@ if ((! isset($_POST['key']) || ! password_verify($CONFIG['thissitekey'], $_POST[
}
}
// END Block poster
-
exit(0);
} else {
// Determine default view style
@@ -462,7 +461,7 @@ function get_header_search($group, $terms)
}
$article_dbh = article_db_open($article_database);
$article_stmt = $article_dbh->prepare("SELECT * FROM articles WHERE number=:number");
- if (is_multibyte($_POST['terms'])) {
+ if (!isset($_POST['data']) && is_multibyte($_POST['terms'])) {
$stmt = $dbh->prepare("SELECT * FROM $table WHERE newsgroup=:group");
$stmt->bindParam(':group', $group);
$stmt->execute();
diff --git a/Rocksolid_Light/rslight/phpmailer.inc.php b/Rocksolid_Light/rslight/phpmailer.inc.php
index 12936de..ccd6775 100644
--- a/Rocksolid_Light/rslight/phpmailer.inc.php
+++ b/Rocksolid_Light/rslight/phpmailer.inc.php
@@ -23,4 +23,4 @@ $mailer['password'] = "password";
require $phpmailer['phpmailer'];
require $phpmailer['smtp'];
-?>
+require $phpmailer['exception'];
diff --git a/Rocksolid_Light/rslight/scripts/expire.php b/Rocksolid_Light/rslight/scripts/expire.php
index a47ec7d..317a3a4 100644
--- a/Rocksolid_Light/rslight/scripts/expire.php
+++ b/Rocksolid_Light/rslight/scripts/expire.php
@@ -194,13 +194,6 @@ function vacuum_group_database($group)
$article_dbh = null;
}
}
- $database = $spooldir . '/' . $group . '-data.db3';
- if ($data_dbh = threads_db_open($database)) {
- file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " " . $group . " VACUUM threads database...", FILE_APPEND);
- $data_stmt = $data_dbh->prepare('VACUUM');
- $data_stmt->execute();
- $data_dbh = null;
- }
// Check for moderation flag here. Yes, in vacuum.
is_moderated($group);
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " " . $group . " Checked for moderation flag", FILE_APPEND);
diff --git a/Rocksolid_Light/rslight/scripts/rslight-lib.php b/Rocksolid_Light/rslight/scripts/rslight-lib.php
index 1bcf7b2..cd36e60 100644
--- a/Rocksolid_Light/rslight/scripts/rslight-lib.php
+++ b/Rocksolid_Light/rslight/scripts/rslight-lib.php
@@ -284,12 +284,12 @@ function prepare_post($filename)
$bbsmail_check = "@@RSL";
foreach ($message as $line) {
- if (trim($line) == "" || $lines > 0) {
+ if (trim($line) == "" && $lines > 0) {
$is_header = 0;
$lines ++;
}
- if ($lines > 0 && $is_header = 0) {
- $break;
+ if ($lines > 0 && $is_header == 0) {
+ break;
}
if (stripos($line, "From: ") === 0) {
$lines ++;
@@ -363,9 +363,11 @@ function process_post($message, $group)
/* Process post */
foreach ($message as $line) {
$bytes = $bytes + mb_strlen($line, '8bit');
- if (trim($line) == "" || $lines > 0) {
+ if (trim($line) == "" && $lines > 0) {
$is_header = 0;
$lines ++;
+ } else {
+ $lines ++;
}
if ($is_header == 0) {
$body .= $line . "\n";
@@ -486,9 +488,11 @@ function process_post($message, $group)
$lines = 0;
$ng = 0;
foreach ($message as $line) {
- if (trim($line) == "" || $lines > 0) {
+ if (trim($line) == "" && $lines > 0) {
$is_header = 0;
$lines ++;
+ } else {
+ $lines ++;
}
if (stripos($line, "Newsgroups: ") === 0 && $is_header == 1) {
fputs($postfilehandle, "Newsgroups: " . $newsgroups . "\r\n");
@@ -1140,12 +1144,6 @@ function get_list($mode, $ngroup, $msgsock)
}
}
-/*
- * function encode_subject($line) {
- * $newstring=mb_encode_mimeheader(quoted_printable_decode($line));
- * return $newstring;
- * }
- */
function insert_article($section, $nntp_group, $filename, $subject_i, $from_i, $article_date, $date_i, $mid_i, $references_i, $bytes_i, $lines_i, $xref_i, $body)
{
global $enable_rslight, $spooldir, $CONFIG, $OVERRIDES, $logdir, $lockdir, $logfile;
@@ -1202,19 +1200,6 @@ function insert_article($section, $nntp_group, $filename, $subject_i, $from_i, $
$header = 1;
$tmp_file_handle = fopen($tmp_file, 'w');
while ($buf = fgets($in_file)) {
- if ($header == 1) {
- if (stripos($buf, "Content-Type: ") === 0) {
- preg_match('/.*charset=.*/', $buf, $te);
- $content_type = explode("Content-Type: text/plain; charset=", $te[0]);
- }
- if (stripos($buf, "Newsgroups: ") === 0) {
- $response = str_ireplace($group, $group, $buf);
- // Identify each group name for xref
- $groupnames = explode("Newsgroups: ", $buf);
- $allgroups = preg_split("/\ |\,/", $groupnames[1]);
- $ref = 0;
- }
- } else {}
if ((trim($buf) == "") && ($header == 1)) {
$current_article['xref'] = "Xref: " . $CONFIG['pathhost'];
foreach ($allgroups as $agroup) {
@@ -1235,6 +1220,19 @@ function insert_article($section, $nntp_group, $filename, $subject_i, $from_i, $
fputs($tmp_file_handle, $current_article['xref'] . PHP_EOL);
$buf .= '';
}
+ if ($header == 1) {
+ if (stripos($buf, "Content-Type: ") === 0) {
+ preg_match('/.*charset=.*/', $buf, $te);
+ $content_type = explode("Content-Type: text/plain; charset=", $te[0]);
+ }
+ if (stripos($buf, "Newsgroups: ") === 0) {
+ $response = str_ireplace($group, $group, $buf);
+ // Identify each group name for xref
+ $groupnames = explode("Newsgroups: ", $buf);
+ $allgroups = preg_split("/\ |\,/", $groupnames[1]);
+ $ref = 0;
+ }
+ }
fputs($tmp_file_handle, rtrim($buf, "\n\r") . PHP_EOL);
}
fputs($tmp_file_handle, "\n.\n");
diff --git a/Rocksolid_Light/spoolnews/user.php b/Rocksolid_Light/spoolnews/user.php
index 75294d8..57140b5 100644
--- a/Rocksolid_Light/spoolnews/user.php
+++ b/Rocksolid_Light/spoolnews/user.php
@@ -85,7 +85,7 @@ if(!$logged_in) {
if ($ip_pass) {
$_SESSION['pass'] = true;
}
- set_user_logged_in_cookies($name, $keys);
+ set_user_logged_in_cookies(trim($_POST['username']), $keys);
$logged_in = true;
} else {
echo 'Authentication Required';