Edit list of nicknames permitted to post to the newswire

merge-requests/8/head
Bob Mottram 2020-10-05 19:51:35 +01:00
parent 8ec06c612b
commit 6997ae6e96
17 changed files with 57 additions and 15 deletions

View File

@ -2893,6 +2893,17 @@ class PubServer(BaseHTTPRequestHandler):
if os.path.isfile(newswireFilename): if os.path.isfile(newswireFilename):
os.remove(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 # redirect back to the default timeline
if callingDomain.endswith('.onion') and \ if callingDomain.endswith('.onion') and \
onionDomain: onionDomain:

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "تغذية RSS لهذا الموقع", "RSS feed for this site": "تغذية RSS لهذا الموقع",
"Edit newswire": "تحرير الأخبار", "Edit newswire": "تحرير الأخبار",
"Add RSS feed links below.": "إضافة روابط تغذية RSS أدناه.", "Add RSS feed links below.": "إضافة روابط تغذية RSS أدناه.",
"Newswire RSS Feed": "Newswire موجز RSS" "Newswire RSS Feed": "Newswire موجز RSS",
"Nicknames whose blog entries appear on the newswire.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "Feed RSS per a aquest lloc", "RSS feed for this site": "Feed RSS per a aquest lloc",
"Edit newswire": "Editeu newswire", "Edit newswire": "Editeu newswire",
"Add RSS feed links below.": "Afegiu enllaços de canals RSS a continuació.", "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.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "Porthiant RSS ar gyfer y wefan hon", "RSS feed for this site": "Porthiant RSS ar gyfer y wefan hon",
"Edit newswire": "Golygu newyddion", "Edit newswire": "Golygu newyddion",
"Add RSS feed links below.": "Ychwanegwch ddolenni porthiant RSS isod.", "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.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "RSS-Feed für diese Site", "RSS feed for this site": "RSS-Feed für diese Site",
"Edit newswire": "Newswire bearbeiten", "Edit newswire": "Newswire bearbeiten",
"Add RSS feed links below.": "Fügen Sie unten RSS-Feed-Links hinzu.", "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.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "RSS feed for this site", "RSS feed for this site": "RSS feed for this site",
"Edit newswire": "Edit newswire", "Edit newswire": "Edit newswire",
"Add RSS feed links below.": "Add RSS feed links below.", "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."
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "Fuente RSS para este sitio", "RSS feed for this site": "Fuente RSS para este sitio",
"Edit newswire": "Editar newswire", "Edit newswire": "Editar newswire",
"Add RSS feed links below.": "Agregue los enlaces de fuentes RSS a continuación.", "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.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "Flux RSS de ce site", "RSS feed for this site": "Flux RSS de ce site",
"Edit newswire": "Modifier le fil d'actualité", "Edit newswire": "Modifier le fil d'actualité",
"Add RSS feed links below.": "Ajoutez des liens de flux RSS ci-dessous.", "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.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "Fotha RSS don láithreán seo", "RSS feed for this site": "Fotha RSS don láithreán seo",
"Edit newswire": "Cuir sreang nuachta in eagar", "Edit newswire": "Cuir sreang nuachta in eagar",
"Add RSS feed links below.": "Cuir naisc beatha RSS thíos.", "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.": ""
} }

View File

@ -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 फ़ीड" "Newswire RSS Feed": "Newswire RSS फ़ीड",
"Nicknames whose blog entries appear on the newswire.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "Feed RSS per questo sito", "RSS feed for this site": "Feed RSS per questo sito",
"Edit newswire": "Modifica newswire", "Edit newswire": "Modifica newswire",
"Add RSS feed links below.": "Aggiungi i link ai feed RSS di seguito.", "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.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "このサイトのRSSフィード", "RSS feed for this site": "このサイトのRSSフィード",
"Edit newswire": "ニュースワイヤーを編集", "Edit newswire": "ニュースワイヤーを編集",
"Add RSS feed links below.": "以下にRSSフィードリンクを追加します。", "Add RSS feed links below.": "以下にRSSフィードリンクを追加します。",
"Newswire RSS Feed": "NewswireRSSフィード" "Newswire RSS Feed": "NewswireRSSフィード",
"Nicknames whose blog entries appear on the newswire.": ""
} }

View File

@ -292,5 +292,6 @@
"RSS feed for this site": "RSS feed for this site", "RSS feed for this site": "RSS feed for this site",
"Edit newswire": "Edit newswire", "Edit newswire": "Edit newswire",
"Add RSS feed links below.": "Add RSS feed links below.", "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."
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "Feed RSS para este site", "RSS feed for this site": "Feed RSS para este site",
"Edit newswire": "Editar notícias", "Edit newswire": "Editar notícias",
"Add RSS feed links below.": "Adicione links de feed RSS abaixo.", "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.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "RSS-канал для этого сайта", "RSS feed for this site": "RSS-канал для этого сайта",
"Edit newswire": "Редактировать ленту новостей", "Edit newswire": "Редактировать ленту новостей",
"Add RSS feed links below.": "Добавьте ссылки на RSS-канал ниже.", "Add RSS feed links below.": "Добавьте ссылки на RSS-канал ниже.",
"Newswire RSS Feed": "Лента новостей RSS" "Newswire RSS Feed": "Лента новостей RSS",
"Nicknames whose blog entries appear on the newswire.": ""
} }

View File

@ -296,5 +296,6 @@
"RSS feed for this site": "该站点的RSS feed", "RSS feed for this site": "该站点的RSS feed",
"Edit newswire": "编辑新闻专线", "Edit newswire": "编辑新闻专线",
"Add RSS feed links below.": "在下面添加RSS feed链接。", "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.": ""
} }

View File

@ -1326,6 +1326,13 @@ def htmlEditNewswire(translate: {}, baseDir: str, path: str,
with open(newswireFilename, 'r') as fp: with open(newswireFilename, 'r') as fp:
newswireStr = fp.read() 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 += \
'<div class="container">' '<div class="container">'
editNewswireForm += \ editNewswireForm += \
@ -1335,6 +1342,15 @@ def htmlEditNewswire(translate: {}, baseDir: str, path: str,
editNewswireForm += \ editNewswireForm += \
' <textarea id="message" name="editedNewswire" ' + \ ' <textarea id="message" name="editedNewswire" ' + \
'style="height:500px">' + newswireStr + '</textarea>' 'style="height:500px">' + newswireStr + '</textarea>'
editNewswireForm += \
' ' + \
translate['Nicknames whose blog entries appear on the newswire.'] + \
'<br>'
editNewswireForm += \
' <textarea id="message" name="trustedNewswire" ' + \
'style="height:500px">' + newswireTrusted + '</textarea>'
editNewswireForm += \ editNewswireForm += \
'</div>' '</div>'