瀏覽代碼

Merge pull request #1451 from Alkarex/anonymous-fix-403

Do not mark as read in anonymous mode
Alexandre Alapetite 9 年之前
父節點
當前提交
29b4fbcf0a
共有 3 個文件被更改,包括 3 次插入0 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 0
      app/views/helpers/javascript_vars.phtml
  3. 1 0
      p/scripts/main.js

+ 1 - 0
CHANGELOG.md

@@ -14,6 +14,7 @@
 * Bug fixing
 * Bug fixing
 	* Fix PostgreSQL bugs with API and feed modifications [#1417](https://github.com/FreshRSS/FreshRSS/pull/1417)
 	* Fix PostgreSQL bugs with API and feed modifications [#1417](https://github.com/FreshRSS/FreshRSS/pull/1417)
 	* Allow empty strings in CLI do-install [#1435](https://github.com/FreshRSS/FreshRSS/pull/1435)
 	* Allow empty strings in CLI do-install [#1435](https://github.com/FreshRSS/FreshRSS/pull/1435)
+	* Do not mark as read in anonymous mode [#1431](https://github.com/FreshRSS/FreshRSS/issues/1431)
 * Security
 * Security
 	* Sanitize feed Web site URL [#1434](https://github.com/FreshRSS/FreshRSS/issues/1434)
 	* Sanitize feed Web site URL [#1434](https://github.com/FreshRSS/FreshRSS/issues/1434)
 	* No version number for anonymous users [#1404](https://github.com/FreshRSS/FreshRSS/issues/1404)
 	* No version number for anonymous users [#1404](https://github.com/FreshRSS/FreshRSS/issues/1404)

+ 1 - 0
app/views/helpers/javascript_vars.phtml

@@ -3,6 +3,7 @@ $mark = FreshRSS_Context::$user_conf->mark_when;
 $s = FreshRSS_Context::$user_conf->shortcuts;
 $s = FreshRSS_Context::$user_conf->shortcuts;
 echo htmlspecialchars(json_encode(array(
 echo htmlspecialchars(json_encode(array(
 	'context' => array(
 	'context' => array(
+		'anonymous' => !FreshRSS_Auth::hasAccess(),
 		'auto_remove_article' => !!FreshRSS_Context::isAutoRemoveAvailable(),
 		'auto_remove_article' => !!FreshRSS_Context::isAutoRemoveAvailable(),
 		'hide_posts' => !(FreshRSS_Context::$user_conf->display_posts || Minz_Request::actionName() === 'reader'),
 		'hide_posts' => !(FreshRSS_Context::$user_conf->display_posts || Minz_Request::actionName() === 'reader'),
 		'display_order' => Minz_Request::param('order', FreshRSS_Context::$user_conf->sort_order),
 		'display_order' => Minz_Request::param('order', FreshRSS_Context::$user_conf->sort_order),

+ 1 - 0
p/scripts/main.js

@@ -117,6 +117,7 @@ function incUnreadsFeed(article, feed_id, nb) {
 var pending_entries = {};
 var pending_entries = {};
 function mark_read(active, only_not_read) {
 function mark_read(active, only_not_read) {
 	if ((active.length === 0) || (!active.attr('id')) ||
 	if ((active.length === 0) || (!active.attr('id')) ||
+		context.anonymous ||
 		(only_not_read && !active.hasClass("not_read"))) {
 		(only_not_read && !active.hasClass("not_read"))) {
 		return false;
 		return false;
 	}
 	}