aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-09-14 20:23:33 +0200
committerGravatar GitHub <noreply@github.com> 2023-09-14 20:23:33 +0200
commitbc5666cd27ee1172f89603982a44c143ceae08fd (patch)
tree79996cc8aa67b70b8159aaef86a5634b7e8afaab /app
parent52d87c3eaa352b765e1be3c2c0b9a3ce0bfabdc8 (diff)
Fix labels in anonymous mode (#5650)
* Fix labels in anonymous mode fix https://github.com/FreshRSS/FreshRSS/issues/4305 * Show all tags * Revert "Show all tags" This reverts commit 24dfba501729cea32943548bc829d3581883de50. * Add message when no labels * fixed no label style * i18n de translation * Fix in non-anomymous mode * No class in anonymous mode --------- Co-authored-by: maTh <1645099+math-GH@users.noreply.github.com> Co-authored-by: math-gh <>
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/tagController.php21
-rw-r--r--app/i18n/cz/gen.php1
-rw-r--r--app/i18n/de/gen.php1
-rw-r--r--app/i18n/el/gen.php1
-rw-r--r--app/i18n/en-us/gen.php1
-rw-r--r--app/i18n/en/gen.php1
-rw-r--r--app/i18n/es/gen.php1
-rw-r--r--app/i18n/fa/gen.php1
-rw-r--r--app/i18n/fr/gen.php1
-rw-r--r--app/i18n/he/gen.php1
-rwxr-xr-xapp/i18n/hu/gen.php1
-rw-r--r--app/i18n/id/gen.php1
-rw-r--r--app/i18n/it/gen.php1
-rw-r--r--app/i18n/ja/gen.php1
-rw-r--r--app/i18n/ko/gen.php1
-rw-r--r--app/i18n/lv/gen.php1
-rw-r--r--app/i18n/nl/gen.php1
-rw-r--r--app/i18n/oc/gen.php1
-rw-r--r--app/i18n/pl/gen.php1
-rw-r--r--app/i18n/pt-br/gen.php1
-rw-r--r--app/i18n/ru/gen.php1
-rw-r--r--app/i18n/sk/gen.php1
-rw-r--r--app/i18n/tr/gen.php1
-rw-r--r--app/i18n/zh-cn/gen.php1
-rw-r--r--app/i18n/zh-tw/gen.php1
-rw-r--r--app/views/helpers/javascript_vars.phtml1
26 files changed, 43 insertions, 3 deletions
diff --git a/app/Controllers/tagController.php b/app/Controllers/tagController.php
index 68ef36111..4536e3f13 100644
--- a/app/Controllers/tagController.php
+++ b/app/Controllers/tagController.php
@@ -17,9 +17,6 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController {
* underlying framework.
*/
public function firstAction(): void {
- if (!FreshRSS_Auth::hasAccess()) {
- Minz_Error::error(403);
- }
// If ajax request, we do not print layout
$this->ajax = Minz_Request::paramBoolean('ajax');
if ($this->ajax) {
@@ -32,6 +29,9 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController {
* This action adds (checked=true) or removes (checked=false) a tag to an entry.
*/
public function tagEntryAction(): void {
+ if (!FreshRSS_Auth::hasAccess()) {
+ Minz_Error::error(403);
+ }
if (Minz_Request::isPost()) {
$id_tag = Minz_Request::paramInt('id_tag');
$name_tag = Minz_Request::paramString('name_tag');
@@ -64,6 +64,9 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController {
}
public function deleteAction(): void {
+ if (!FreshRSS_Auth::hasAccess()) {
+ Minz_Error::error(403);
+ }
if (Minz_Request::isPost()) {
$id_tag = Minz_Request::paramInt('id_tag');
if ($id_tag !== 0) {
@@ -82,6 +85,9 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController {
}
public function getTagsForEntryAction(): void {
+ if (!FreshRSS_Auth::hasAccess() && !FreshRSS_Context::$system_conf->allow_anonymous) {
+ Minz_Error::error(403);
+ }
$this->view->_layout(null);
header('Content-Type: application/json; charset=UTF-8');
header('Cache-Control: private, no-cache, no-store, must-revalidate');
@@ -91,6 +97,9 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController {
}
public function addAction(): void {
+ if (!FreshRSS_Auth::hasAccess()) {
+ Minz_Error::error(403);
+ }
if (!Minz_Request::isPost()) {
Minz_Error::error(405);
}
@@ -110,6 +119,9 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController {
* @throws Minz_PDOConnectionException|JsonException
*/
public function renameAction(): void {
+ if (!FreshRSS_Auth::hasAccess()) {
+ Minz_Error::error(403);
+ }
if (!Minz_Request::isPost()) {
Minz_Error::error(405);
}
@@ -139,6 +151,9 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController {
}
public function indexAction(): void {
+ if (!FreshRSS_Auth::hasAccess()) {
+ Minz_Error::error(403);
+ }
$tagDAO = FreshRSS_Factory::createTagDao();
$this->view->tags = $tagDAO->listTags() ?: [];
}
diff --git a/app/i18n/cz/gen.php b/app/i18n/cz/gen.php
index 8ee8619bd..4f032ad78 100644
--- a/app/i18n/cz/gen.php
+++ b/app/i18n/cz/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Požadavek selhal, to může být způsobeno problémy s připojení k internetu.',
'title_new_articles' => 'FreshRSS: nové články!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Jsou dostupné nové články, klikněte pro obnovení stránky.',
'should_be_activated' => 'JavaScript musí být povolen',
),
diff --git a/app/i18n/de/gen.php b/app/i18n/de/gen.php
index a14b7171e..1912b58fa 100644
--- a/app/i18n/de/gen.php
+++ b/app/i18n/de/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Eine Anfrage ist fehlgeschlagen, dies könnte durch Probleme mit der Internetverbindung verursacht worden sein.',
'title_new_articles' => 'FreshRSS: neue Artikel!',
),
+ 'labels_empty' => 'Keine Labels',
'new_article' => 'Es gibt neue verfügbare Artikel. Klicken Sie, um die Seite zu aktualisieren.',
'should_be_activated' => 'JavaScript muss aktiviert sein',
),
diff --git a/app/i18n/el/gen.php b/app/i18n/el/gen.php
index 62a6c206a..f36d9731f 100644
--- a/app/i18n/el/gen.php
+++ b/app/i18n/el/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'A request has failed, it may have been caused by internet connection problems.', // TODO
'title_new_articles' => 'FreshRSS: new articles!', // TODO
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'There are new articles available, click to refresh the page.', // TODO
'should_be_activated' => 'JavaScript must be enabled', // TODO
),
diff --git a/app/i18n/en-us/gen.php b/app/i18n/en-us/gen.php
index 3393a599a..aad06ebbe 100644
--- a/app/i18n/en-us/gen.php
+++ b/app/i18n/en-us/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'A request has failed, it may have been caused by internet connection problems.', // IGNORE
'title_new_articles' => 'FreshRSS: new articles!', // IGNORE
),
+ 'labels_empty' => 'No labels', // IGNORE
'new_article' => 'There are new articles available, click to refresh the page.', // IGNORE
'should_be_activated' => 'JavaScript must be enabled', // IGNORE
),
diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php
index 8cd09989c..247c63540 100644
--- a/app/i18n/en/gen.php
+++ b/app/i18n/en/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'A request has failed, it may have been caused by internet connection problems.',
'title_new_articles' => 'FreshRSS: new articles!',
),
+ 'labels_empty' => 'No labels',
'new_article' => 'There are new articles available, click to refresh the page.',
'should_be_activated' => 'JavaScript must be enabled',
),
diff --git a/app/i18n/es/gen.php b/app/i18n/es/gen.php
index 7235cd81b..3dddabdb6 100644
--- a/app/i18n/es/gen.php
+++ b/app/i18n/es/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'La petición ha fallado. Puede ser debido a problemas de conexión a internet.',
'title_new_articles' => 'FreshRSS: ¡Nuevos artículos!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Hay nuevos artículos disponibles. Pincha para refrescar la página.',
'should_be_activated' => 'JavaScript debe estar activado',
),
diff --git a/app/i18n/fa/gen.php b/app/i18n/fa/gen.php
index b1d073508..a3cbc8419 100644
--- a/app/i18n/fa/gen.php
+++ b/app/i18n/fa/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => ' یک درخواست شکست خورده است',
'title_new_articles' => ' FreshRSS: مقالات جدید!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'مقالات جدیدی موجود است',
'should_be_activated' => ' جاوا اسکریپت باید فعال باشد',
),
diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php
index e0b1f975f..852edb32a 100644
--- a/app/i18n/fr/gen.php
+++ b/app/i18n/fr/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Une requête a échoué, cela peut être dû à des problèmes de connexion à Internet.',
'title_new_articles' => 'FreshRSS : nouveaux articles !',
),
+ 'labels_empty' => 'Pas d’étiquettes', // DIRTY
'new_article' => 'Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.',
'should_be_activated' => 'Le JavaScript doit être activé.',
),
diff --git a/app/i18n/he/gen.php b/app/i18n/he/gen.php
index 045aa3bcc..7e5c25ed6 100644
--- a/app/i18n/he/gen.php
+++ b/app/i18n/he/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'A request has failed, it may have been caused by internet connection problems.', // TODO
'title_new_articles' => 'FreshRSS: מאמרים חדשים!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'מאמרים חדשים זמינים, לחצו לרענון העמוד.',
'should_be_activated' => 'חובה להפעיל JavaScript',
),
diff --git a/app/i18n/hu/gen.php b/app/i18n/hu/gen.php
index 11d34f368..5682b5a2b 100755
--- a/app/i18n/hu/gen.php
+++ b/app/i18n/hu/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Egy művelet nem sikerült, lehetséges hogy az internet kapcsolattal vannak problémák.',
'title_new_articles' => 'FreshRSS: új cikkek!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Új cikkek elérhetőek, kattints a lap frissítéséhez.',
'should_be_activated' => 'A JavaScript futtatásának engedélyezve kell lennie',
),
diff --git a/app/i18n/id/gen.php b/app/i18n/id/gen.php
index cc7c25889..22e27c531 100644
--- a/app/i18n/id/gen.php
+++ b/app/i18n/id/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'A request has failed, it may have been caused by internet connection problems.', // TODO
'title_new_articles' => 'FreshRSS: new articles!', // TODO
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'There are new articles available, click to refresh the page.', // TODO
'should_be_activated' => 'JavaScript must be enabled', // TODO
),
diff --git a/app/i18n/it/gen.php b/app/i18n/it/gen.php
index d6828b110..ef32cbb69 100644
--- a/app/i18n/it/gen.php
+++ b/app/i18n/it/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Richiesta fallita, probabilmente a causa di problemi di connessione',
'title_new_articles' => 'Feed RSS Reader: nuovi articoli!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Sono disponibili nuovi articoli, clicca qui per caricarli.',
'should_be_activated' => 'JavaScript deve essere abilitato',
),
diff --git a/app/i18n/ja/gen.php b/app/i18n/ja/gen.php
index f5798cfd9..203d7bd79 100644
--- a/app/i18n/ja/gen.php
+++ b/app/i18n/ja/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'おそらくインターネット接続に問題があるため、リクエストは失敗しました。',
'title_new_articles' => 'FreshRSS: 新規記事!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => '新しい記事があるのでクリックしてページをリフレッシュしてください。',
'should_be_activated' => 'JavaScriptは有効になっている必要があります。',
),
diff --git a/app/i18n/ko/gen.php b/app/i18n/ko/gen.php
index 5619fca70..217bff916 100644
--- a/app/i18n/ko/gen.php
+++ b/app/i18n/ko/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => '요청한 작업을 수행할 수 없습니다. 인터넷 연결에 문제가 발생한 것 같습니다.',
'title_new_articles' => 'FreshRSS: 새 글이 있습니다!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => '새 글이 있습니다. 여기를 클릭하면 페이지를 다시 불러옵니다.',
'should_be_activated' => '자바스크립트를 사용하도록 설정해야합니다',
),
diff --git a/app/i18n/lv/gen.php b/app/i18n/lv/gen.php
index a86f4a027..af71318e4 100644
--- a/app/i18n/lv/gen.php
+++ b/app/i18n/lv/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Pieprasījums nav izdevies, iespējams, to izraisījušas interneta savienojuma problēmas.',
'title_new_articles' => 'FreshRSS: jauni raksti!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Ir pieejami jauni raksti, noklikšķiniet, lai atsvaidzinātu lapu..',
'should_be_activated' => 'JavaScript jābūt ieslēgtam',
),
diff --git a/app/i18n/nl/gen.php b/app/i18n/nl/gen.php
index d5e39e654..1cde8de82 100644
--- a/app/i18n/nl/gen.php
+++ b/app/i18n/nl/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Een opdracht is mislukt, mogelijk door Internet verbindings problemen.',
'title_new_articles' => 'FreshRSS: nieuwe artikelen!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Er zijn nieuwe artikelen beschikbaar. Klik om de pagina te vernieuwen.',
'should_be_activated' => 'JavaScript moet aanstaan',
),
diff --git a/app/i18n/oc/gen.php b/app/i18n/oc/gen.php
index 32b664fc1..efa25bca7 100644
--- a/app/i18n/oc/gen.php
+++ b/app/i18n/oc/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Una requèsta a fach meuca, aquò pòt venir d’un problèma de connexion Internet.',
'title_new_articles' => 'FreshRSS : nòus articles !',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'I a d’articles nòus disponibles, clicatz per actualizar la pagina.',
'should_be_activated' => 'JavaScript deu èsser activat',
),
diff --git a/app/i18n/pl/gen.php b/app/i18n/pl/gen.php
index 4e8185406..e7ddda0c2 100644
--- a/app/i18n/pl/gen.php
+++ b/app/i18n/pl/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Zapytanie nie powiodło się. Może to być spowodowane problemami z łącznością z internetem.',
'title_new_articles' => 'FreshRSS: nowe wiadomości!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Dostępne są nowe wiadomości. Kliknij, aby odświeżyć stronę.',
'should_be_activated' => 'JavaScript musi być włączony',
),
diff --git a/app/i18n/pt-br/gen.php b/app/i18n/pt-br/gen.php
index b72f45f73..a4b1c1b2e 100644
--- a/app/i18n/pt-br/gen.php
+++ b/app/i18n/pt-br/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Uma solicitação falhou, isto pode ter sido causado por problemas de conexão com a internet.',
'title_new_articles' => 'FreshRSS: novos artigos!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Há novos artigos disponíveis, clique para atualizar a página.',
'should_be_activated' => 'O JavaScript precisa estar ativo',
),
diff --git a/app/i18n/ru/gen.php b/app/i18n/ru/gen.php
index d66f21f83..c773d5ba7 100644
--- a/app/i18n/ru/gen.php
+++ b/app/i18n/ru/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Запрос не удался. Возможно, это вызвано проблемами с подключением к Интернет.',
'title_new_articles' => 'FreshRSS: новые статьи!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Появились новые статьи. Нажмите, чтобы обновить страницу.',
'should_be_activated' => 'JavaScript должен быть включён',
),
diff --git a/app/i18n/sk/gen.php b/app/i18n/sk/gen.php
index 30d011a5a..bb95f030c 100644
--- a/app/i18n/sk/gen.php
+++ b/app/i18n/sk/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Nepodarilo sa spracovať váš dopyt, pravdepodobne kvôli problému s pripojením do internetu.',
'title_new_articles' => 'FreshRSS: nové články!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Našli sa nové články. Kliknite na obnovenie stránky.',
'should_be_activated' => 'Musíte povoliť JavaScript',
),
diff --git a/app/i18n/tr/gen.php b/app/i18n/tr/gen.php
index e94866a20..43d74eb28 100644
--- a/app/i18n/tr/gen.php
+++ b/app/i18n/tr/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => 'Hata. İnternet bağlantınızı kontrol edin.',
'title_new_articles' => 'FreshRSS: yeni makaleler!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => 'Yeni makaleler mevcut. Sayfayı yenilemek için tıklayın.',
'should_be_activated' => 'JavaScript aktif olmalıdır.',
),
diff --git a/app/i18n/zh-cn/gen.php b/app/i18n/zh-cn/gen.php
index 4f16388be..28b834d55 100644
--- a/app/i18n/zh-cn/gen.php
+++ b/app/i18n/zh-cn/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => '请求失败,这可能是因为网络连接问题。',
'title_new_articles' => 'FreshRSS: 新文章!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => '发现新文章,点击刷新页面。',
'should_be_activated' => '必须启用 JavaScript',
),
diff --git a/app/i18n/zh-tw/gen.php b/app/i18n/zh-tw/gen.php
index 9b2b63c7a..d76cf1ee7 100644
--- a/app/i18n/zh-tw/gen.php
+++ b/app/i18n/zh-tw/gen.php
@@ -134,6 +134,7 @@ return array(
'request_failed' => '請求失敗,這可能是因為網絡連接問題。',
'title_new_articles' => 'FreshRSS: 新文章!',
),
+ 'labels_empty' => 'No labels', // TODO
'new_article' => '發現新文章,點擊刷新頁面。',
'should_be_activated' => '必須啟用 JavaScript',
),
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 03ed96a9e..1aaa377d1 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -65,6 +65,7 @@ echo htmlspecialchars(json_encode(array(
'notif_body_unread_articles' => _t('gen.js.feedback.body_unread_articles'),
'notif_request_failed' => _t('gen.js.feedback.request_failed'),
'category_empty' => _t('gen.js.category_empty'),
+ 'labels_empty' => _t('gen.js.labels_empty'),
'language' => FreshRSS_Context::$user_conf->language,
),
'icons' => array(