From 6997ae6e96b2c4e5a5f2230e69a115bdadf92c0f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 5 Oct 2020 19:51:35 +0100 Subject: [PATCH] Edit list of nicknames permitted to post to the newswire --- daemon.py | 11 +++++++++++ translations/ar.json | 3 ++- translations/ca.json | 3 ++- translations/cy.json | 3 ++- translations/de.json | 3 ++- translations/en.json | 3 ++- translations/es.json | 3 ++- translations/fr.json | 3 ++- translations/ga.json | 3 ++- translations/hi.json | 3 ++- translations/it.json | 3 ++- translations/ja.json | 3 ++- translations/oc.json | 3 ++- translations/pt.json | 3 ++- translations/ru.json | 3 ++- translations/zh.json | 3 ++- webinterface.py | 16 ++++++++++++++++ 17 files changed, 57 insertions(+), 15 deletions(-) diff --git a/daemon.py b/daemon.py index 01cf419b3..626d50a0d 100644 --- a/daemon.py +++ b/daemon.py @@ -2893,6 +2893,17 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(newswireFilename): os.remove(newswireFilename) + newswireTrustedFilename = baseDir + '/accounts/newswiretrusted.txt' + if fields.get('trustedNewswire'): + newswireTrusted = fields['trustedNewswire'] + trustFile = open(newswireTrustedFilename, "w+") + if trustFile: + trustFile.write(newswireTrusted) + trustFile.close() + else: + if os.path.isfile(newswireTrustedFilename): + os.remove(newswireTrustedFilename) + # redirect back to the default timeline if callingDomain.endswith('.onion') and \ onionDomain: diff --git a/translations/ar.json b/translations/ar.json index ae92a954a..86fff1f1d 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -296,5 +296,6 @@ "RSS feed for this site": "تغذية RSS لهذا الموقع", "Edit newswire": "تحرير الأخبار", "Add RSS feed links below.": "إضافة روابط تغذية RSS أدناه.", - "Newswire RSS Feed": "Newswire موجز RSS" + "Newswire RSS Feed": "Newswire موجز RSS", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/ca.json b/translations/ca.json index 5671b1dbc..2e54acacf 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -296,5 +296,6 @@ "RSS feed for this site": "Feed RSS per a aquest lloc", "Edit newswire": "Editeu newswire", "Add RSS feed links below.": "Afegiu enllaços de canals RSS a continuació.", - "Newswire RSS Feed": "Feed RSS de Newswire" + "Newswire RSS Feed": "Feed RSS de Newswire", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/cy.json b/translations/cy.json index b5f824854..b594eaebe 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -296,5 +296,6 @@ "RSS feed for this site": "Porthiant RSS ar gyfer y wefan hon", "Edit newswire": "Golygu newyddion", "Add RSS feed links below.": "Ychwanegwch ddolenni porthiant RSS isod.", - "Newswire RSS Feed": "Newswire RSS Feed" + "Newswire RSS Feed": "Newswire RSS Feed", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/de.json b/translations/de.json index 00fad6c8a..904fc3cec 100644 --- a/translations/de.json +++ b/translations/de.json @@ -296,5 +296,6 @@ "RSS feed for this site": "RSS-Feed für diese Site", "Edit newswire": "Newswire bearbeiten", "Add RSS feed links below.": "Fügen Sie unten RSS-Feed-Links hinzu.", - "Newswire RSS Feed": "Newswire RSS Feed" + "Newswire RSS Feed": "Newswire RSS Feed", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/en.json b/translations/en.json index 2a12fc9db..644161721 100644 --- a/translations/en.json +++ b/translations/en.json @@ -296,5 +296,6 @@ "RSS feed for this site": "RSS feed for this site", "Edit newswire": "Edit newswire", "Add RSS feed links below.": "Add RSS feed links below.", - "Newswire RSS Feed": "Newswire RSS Feed" + "Newswire RSS Feed": "Newswire RSS Feed", + "Nicknames whose blog entries appear on the newswire.": "Nicknames whose blog entries appear on the newswire." } diff --git a/translations/es.json b/translations/es.json index 2ff5870f5..d6529791e 100644 --- a/translations/es.json +++ b/translations/es.json @@ -296,5 +296,6 @@ "RSS feed for this site": "Fuente RSS para este sitio", "Edit newswire": "Editar newswire", "Add RSS feed links below.": "Agregue los enlaces de fuentes RSS a continuación.", - "Newswire RSS Feed": "Canal RSS de Newswire" + "Newswire RSS Feed": "Canal RSS de Newswire", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/fr.json b/translations/fr.json index 11dec422b..5cecda652 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -296,5 +296,6 @@ "RSS feed for this site": "Flux RSS de ce site", "Edit newswire": "Modifier le fil d'actualité", "Add RSS feed links below.": "Ajoutez des liens de flux RSS ci-dessous.", - "Newswire RSS Feed": "Flux RSS de Newswire" + "Newswire RSS Feed": "Flux RSS de Newswire", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/ga.json b/translations/ga.json index a08ecd81c..73a1899a1 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -296,5 +296,6 @@ "RSS feed for this site": "Fotha RSS don láithreán seo", "Edit newswire": "Cuir sreang nuachta in eagar", "Add RSS feed links below.": "Cuir naisc beatha RSS thíos.", - "Newswire RSS Feed": "Newswire RSS Feed" + "Newswire RSS Feed": "Newswire RSS Feed", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/hi.json b/translations/hi.json index 4caac27f1..ba7800737 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -296,5 +296,6 @@ "RSS feed for this site": "इस साइट के लिए आरएसएस फ़ीड", "Edit newswire": "नवांश संपादित करें", "Add RSS feed links below.": "नीचे आरएसएस फ़ीड लिंक जोड़ें।", - "Newswire RSS Feed": "Newswire RSS फ़ीड" + "Newswire RSS Feed": "Newswire RSS फ़ीड", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/it.json b/translations/it.json index 32008810f..96789121e 100644 --- a/translations/it.json +++ b/translations/it.json @@ -296,5 +296,6 @@ "RSS feed for this site": "Feed RSS per questo sito", "Edit newswire": "Modifica newswire", "Add RSS feed links below.": "Aggiungi i link ai feed RSS di seguito.", - "Newswire RSS Feed": "Feed RSS di Newswire" + "Newswire RSS Feed": "Feed RSS di Newswire", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/ja.json b/translations/ja.json index 108f36f04..3ea04d5a2 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -296,5 +296,6 @@ "RSS feed for this site": "このサイトのRSSフィード", "Edit newswire": "ニュースワイヤーを編集", "Add RSS feed links below.": "以下にRSSフィードリンクを追加します。", - "Newswire RSS Feed": "NewswireRSSフィード" + "Newswire RSS Feed": "NewswireRSSフィード", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/oc.json b/translations/oc.json index 2a7e4d9f1..6f39c0ae5 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -292,5 +292,6 @@ "RSS feed for this site": "RSS feed for this site", "Edit newswire": "Edit newswire", "Add RSS feed links below.": "Add RSS feed links below.", - "Newswire RSS Feed": "Newswire RSS Feed" + "Newswire RSS Feed": "Newswire RSS Feed", + "Nicknames whose blog entries appear on the newswire.": "Nicknames whose blog entries appear on the newswire." } diff --git a/translations/pt.json b/translations/pt.json index 97df10f8c..d755d2080 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -296,5 +296,6 @@ "RSS feed for this site": "Feed RSS para este site", "Edit newswire": "Editar notícias", "Add RSS feed links below.": "Adicione links de feed RSS abaixo.", - "Newswire RSS Feed": "Feed RSS da Newswire" + "Newswire RSS Feed": "Feed RSS da Newswire", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/ru.json b/translations/ru.json index f91883dac..7addcc197 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -296,5 +296,6 @@ "RSS feed for this site": "RSS-канал для этого сайта", "Edit newswire": "Редактировать ленту новостей", "Add RSS feed links below.": "Добавьте ссылки на RSS-канал ниже.", - "Newswire RSS Feed": "Лента новостей RSS" + "Newswire RSS Feed": "Лента новостей RSS", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/translations/zh.json b/translations/zh.json index c9f2aa9a7..74b0c603d 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -296,5 +296,6 @@ "RSS feed for this site": "该站点的RSS feed", "Edit newswire": "编辑新闻专线", "Add RSS feed links below.": "在下面添加RSS feed链接。", - "Newswire RSS Feed": "Newswire RSS提要" + "Newswire RSS Feed": "Newswire RSS提要", + "Nicknames whose blog entries appear on the newswire.": "" } diff --git a/webinterface.py b/webinterface.py index 74fa0392c..3afe1c2d1 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1326,6 +1326,13 @@ def htmlEditNewswire(translate: {}, baseDir: str, path: str, with open(newswireFilename, 'r') as fp: newswireStr = fp.read() + # get the list of handles who are trusted to post to the newswire + newswireTrusted = '' + newswireTrustedFilename = baseDir + '/accounts/newswiretrusted.txt' + if os.path.isfile(newswireTrustedFilename): + with open(newswireTrustedFilename, "r") as trustFile: + newswireTrusted = trustFile.read() + editNewswireForm += \ '
' editNewswireForm += \ @@ -1335,6 +1342,15 @@ def htmlEditNewswire(translate: {}, baseDir: str, path: str, editNewswireForm += \ ' ' + + editNewswireForm += \ + ' ' + \ + translate['Nicknames whose blog entries appear on the newswire.'] + \ + '
' + editNewswireForm += \ + ' ' + editNewswireForm += \ '
'