Commit e8a849ca authored by Sebastian Reichel's avatar Sebastian Reichel

Imported Upstream version 1.7.8+dfsg

parent 89d4bb61
......@@ -310,7 +310,7 @@ class RPC extends Handler_Protected {
catchupArticlesById($this->link, $ids, $cmode);
print json_encode(array("message" => "UPDATE_COUNTERS"));
print json_encode(array("message" => "UPDATE_COUNTERS", "ids" => $ids));
}
function markSelected() {
......
......@@ -318,7 +318,7 @@
global $fetch_last_error;
global $fetch_last_error_code;
if (function_exists('curl_init') && !ini_get("open_basedir")) {
if (!defined('NO_CURL') && function_exists('curl_init') && !ini_get("open_basedir")) {
if (ini_get("safe_mode")) {
$ch = curl_init(geturl($url));
......@@ -397,9 +397,6 @@
$data = @file_get_contents($url);
@$gzdecoded = gzdecode($data);
if ($gzdecoded) $data = $gzdecoded;
if (!$data && function_exists('error_get_last')) {
$error = error_get_last();
$fetch_last_error = $error["message"];
......@@ -747,7 +744,9 @@
cache_prefs($link);
load_user_plugins($link, $_SESSION["uid"]);
} else {
if (!$_SESSION["uid"] || !validate_session($link)) {
if (!validate_session($link)) $_SESSION["uid"] = false;
if (!$_SESSION["uid"]) {
if (AUTH_AUTO_LOGIN && authenticate_user($link, null, null)) {
$_SESSION["ref_schema_version"] = get_schema_version($link, true);
......@@ -755,7 +754,12 @@
authenticate_user($link, null, null, true);
}
if (!$_SESSION["uid"]) render_login_form($link);
if (!$_SESSION["uid"]) {
render_login_form($link);
@session_destroy();
setcookie(session_name(), '', time()-42000, '/');
exit;
}
} else {
/* bump login timestamp */
......@@ -1076,9 +1080,9 @@
$intl = get_pref($link, "FRESH_ARTICLE_MAX_AGE");
if (DB_TYPE == "pgsql") {
$match_part = "updated > NOW() - INTERVAL '$intl hour' ";
$match_part = "date_entered > NOW() - INTERVAL '$intl hour' ";
} else {
$match_part = "updated > DATE_SUB(NOW(),
$match_part = "date_entered > DATE_SUB(NOW(),
INTERVAL $intl HOUR) ";
}
......@@ -1086,7 +1090,7 @@
SET unread = false, last_read = NOW() WHERE ref_id IN
(SELECT id FROM
(SELECT id FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id
AND owner_uid = $owner_uid AND unread = true AND feed_id = $feed AND $date_qpart AND $match_part) as tmp)");
AND owner_uid = $owner_uid AND unread = true AND $date_qpart AND $match_part) as tmp)");
}
if ($feed == -4) {
......@@ -2408,6 +2412,7 @@
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
} else if ($feed == -4) { // all articles virtual feed
$allow_archived = true;
$query_strategy_part = "true";
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
} else if ($feed <= LABEL_BASE_INDEX) { // labels
......@@ -2425,13 +2430,7 @@
$query_strategy_part = "true";
}
if (get_pref($link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
$date_sort_field = "updated";
} else {
$date_sort_field = "date_entered";
}
$order_by = "$date_sort_field DESC, updated DESC";
$order_by = "score DESC, date_entered DESC, updated DESC";
if ($view_mode == "unread_first") {
$order_by = "unread DESC, $order_by";
......
<?php
// WARNING: Don't ask for help on tt-rss.org forums or the bugtracker if you have
// modified this file.
/*
* WARNING!
*
* If you modify this file, you are ON YOUR OWN!
*
* Believe it or not, all of the checks below are required to succeed for
* tt-rss to actually function properly.
*
* If you think you have a better idea about what is or isn't required, feel
* free to modify the file, note though that you are therefore automatically
* disqualified from any further support by official channels, e.g. tt-rss.org
* issue tracker or the forums.
*
* If you come crying when stuff inevitably breaks, you will be mocked and told
* to get out. */
function make_self_url_path() {
$url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
......
......@@ -181,11 +181,6 @@
if (!defined('TTRSS_SESSION_NAME') || TTRSS_SESSION_NAME != 'ttrss_api_sid') {
if (isset($_COOKIE[$session_name])) {
@session_start();
if (!isset($_SESSION["uid"]) || !$_SESSION["uid"] || !validate_session($session_connection)) {
session_destroy();
setcookie(session_name(), '', time()-42000, '/');
}
}
}
?>
<?php
define('VERSION', "1.7.6");
define('VERSION', "1.7.8");
?>
......@@ -187,15 +187,20 @@
<option value="date_reverse"><?php echo __('Oldest first') ?></option>
</select>
<select title="<?php echo __('Mark feed as read') ?>"
onchange="catchupCurrentFeed(this)"
dojoType="dijit.form.Select" name="catchup_feed">
<option selected="selected" value="default"><?php echo __('Mark as read') ?></option>
<option value="all"><?php echo __('All articles') ?></option>
<option value="1day"><?php echo __('Older than one day') ?></option>
<option value="1week"><?php echo __('Older than one week') ?></option>
<option value="2weeks"><?php echo __('Older than two weeks') ?></option>
</select>
<div dojoType="dijit.form.ComboButton" onclick="catchupCurrentFeed()">
<span><?php echo __('Mark as read') ?></span>
<div dojoType="dijit.DropDownMenu">
<div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('1day')">
<?php echo __('Older than one day') ?>
</div>
<div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('1week')">
<?php echo __('Older than one week') ?>
</div>
<div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('2week')">
<?php echo __('Older than two weeks') ?>
</div>
</div>
</div>
</form>
......
......@@ -9,7 +9,7 @@
</head>
<body>
<?
<?php
function sanity_check($db_type) {
$errors = array();
......
......@@ -380,20 +380,8 @@ function getNextUnreadFeed(feed, is_cat) {
}
}
function catchupCurrentFeed(elem) {
if (elem) {
var toolbar = document.forms["main_toolbar_form"];
var catchup_feed = dijit.getEnclosingWidget(toolbar.catchup_feed);
var mode = catchup_feed.attr('value');
if (mode != 'default') {
catchupFeed(getActiveFeedId(), activeFeedIsCat(), mode);
catchup_feed.attr('value', 'default');
}
} else {
catchupFeed(getActiveFeedId(), activeFeedIsCat());
}
function catchupCurrentFeed(mode) {
catchupFeed(getActiveFeedId(), activeFeedIsCat(), mode);
}
function catchupFeedInGroup(id) {
......
......@@ -12,6 +12,7 @@ var catchup_timeout_id = false;
var cids_requested = [];
var loaded_article_ids = [];
var _last_headlines_update = 0;
var has_storage = 'sessionStorage' in window && window['sessionStorage'] !== null;
......@@ -204,6 +205,7 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
}
_infscroll_request_sent = 0;
_last_headlines_update = new Date().getTime();
unpackVisibleHeadlines();
......@@ -1159,7 +1161,6 @@ function postMouseOut(id) {
function unpackVisibleHeadlines() {
try {
if (!isCdmMode()) return;
$$("#headlines-frame > div[id*=RROW]").each(
......@@ -1178,7 +1179,6 @@ function unpackVisibleHeadlines() {
}
);
} catch (e) {
exception_error("unpackVisibleHeadlines", e);
}
......@@ -1209,6 +1209,10 @@ function headlines_scroll_handler(e) {
if (getInitParam("cdm_auto_catchup") == 1) {
// let's get DOM some time to settle down
var ts = new Date().getTime();
if (ts - _last_headlines_update < 100) return;
$$("#headlines-frame > div[id*=RROW][class*=Unread]").each(
function(child) {
if (child.hasClassName("Unread") && $("headlines-frame").scrollTop >
......@@ -1254,7 +1258,11 @@ function catchupBatchedArticles() {
onComplete: function(transport) {
handle_rpc_json(transport);
reply = JSON.parse(transport.responseText);
var batch = reply.ids;
batch.each(function(id) {
console.log(id);
var elem = $("RROW-" + id);
if (elem) elem.removeClassName("Unread");
catchup_id_batch.remove(id);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -42,7 +42,7 @@ class Updater extends Plugin {
case 0:
array_push($log, "Work directory: $work_dir");
if (!is_writable($work_dir) && !is_writable("$parent_dir")) {
if (!is_writable($work_dir) || !is_writable("$parent_dir")) {
$user = posix_getpwuid(posix_geteuid());
$user = $user["name"];
array_push($log, "Both tt-rss and parent directories should be writable as current user ($user).");
......@@ -59,6 +59,10 @@ class Updater extends Plugin {
$stop = true; break;
}
// bah, also humbug
putenv("PATH=" . getenv("PATH") . PATH_SEPARATOR . "/bin" .
PATH_SEPARATOR . "/usr/bin");
array_push($log, "Checking for tar...");
$system_rc = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment