60) { $_SESSION['last_access'] = time(); } $logfile = $logdir . '/newsportal.log'; if (isset($_COOKIE['mail_name'])) { $cookie_mail_name = trim(strtolower($_COOKIE['mail_name'])); if ($_COOKIE['mail_name'] == $CONFIG['anonusername']) { unset($cookie_mail_name); } if ($userdata = get_user_mail_auth_data($cookie_mail_name)) { $userfile = $spooldir . '/' . strtolower($cookie_mail_name) . '-articleviews.dat'; } } // register parameters $id = $_REQUEST["id"]; $group = _rawurldecode($_REQUEST["group"]); if (strpos($id, '@') !== false) { $id = '<' . trim($id, '<> ') . '>'; $database = $spooldir . '/articles-overview.db3'; $overview_dbh = overview_db_open($database); $overview_query = $overview_dbh->prepare('SELECT * FROM overview WHERE msgid=:messageid'); $overview_query->execute([ 'messageid' => $id ]); $found = 0; while ($row = $overview_query->fetch()) { $id = $row['number']; $group = $row['newsgroup']; $found = 1; break; } $overview_dbh = null; if ($found) { $newurl = 'article-flat.php?id=' . $id . '&group=' . urlencode($row['newsgroup']) . '#' . $id; header("Location: $newurl"); die(); } } // Switch to correct section in case group has been moved and link is to old section $findsection = get_section_by_group($group); if (($findsection) && trim($findsection) !== $config_name) { if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') $link = "https"; else $link = "http"; $link .= "://"; $link .= $_SERVER['HTTP_HOST']; $link .= $_SERVER['REQUEST_URI']; // May need to add more characters to escape for regex here $configregex = '|/' . preg_replace('/\+/', '\+', addslashes($config_name)) . '/|'; $newurl = preg_replace($configregex, "/$findsection/", $link); header("Location:$newurl"); die(); } if (isset($_REQUEST["first"])) $first = $_REQUEST["first"]; if (! isset($_SERVER['REQUEST_STRING'])) { $_SERVER['REQUEST_STRING'] = ''; } $location = $_SERVER['REQUEST_URI'] . $_SERVER['REQUEST_STRING']; $_SESSION['return_page'] = $location . '#' . $id; // file_put_contents($accessfile, "\n".format_log_date()." ".$config_name." ".$group.":".$id, FILE_APPEND); if ($userdata) { $userdata[$group] = time(); file_put_contents($userfile, serialize($userdata)); } if (isset($frames_on) && $frames_on === true) { ?> header->subject); header("Last-Modified: " . date("r", $message->header->date)); $title .= ' - ' . $group . ' - ' . $subject; } include "head.inc"; echo '