Przeglądaj źródła

Do not mark as read in anonymous mode

And avoid HTTP 403 https://github.com/FreshRSS/FreshRSS/issues/1431
Alexandre Alapetite 9 lat temu
rodzic
commit
9e698108fe
2 zmienionych plików z 2 dodań i 0 usunięć
  1. 1 0
      app/views/helpers/javascript_vars.phtml
  2. 1 0
      p/scripts/main.js

+ 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;
 echo htmlspecialchars(json_encode(array(
 	'context' => array(
+		'anonymous' => !FreshRSS_Auth::hasAccess(),
 		'auto_remove_article' => !!FreshRSS_Context::isAutoRemoveAvailable(),
 		'hide_posts' => !(FreshRSS_Context::$user_conf->display_posts || Minz_Request::actionName() === 'reader'),
 		'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 = {};
 function mark_read(active, only_not_read) {
 	if ((active.length === 0) || (!active.attr('id')) ||
+		context.anonymous ||
 		(only_not_read && !active.hasClass("not_read"))) {
 		return false;
 	}