Check that the editor is the admin

merge-requests/8/head
Bob Mottram 2020-11-10 12:28:54 +00:00
parent d78139a258
commit 67ea679887
1 changed files with 21 additions and 18 deletions

View File

@ -2908,25 +2908,28 @@ class PubServer(BaseHTTPRequestHandler):
if os.path.isfile(linksFilename):
os.remove(linksFilename)
if fields.get('editedAbout'):
aboutStr = fields['editedAbout']
aboutFile = open(aboutFilename, "w+")
if aboutFile:
aboutFile.write(aboutStr)
aboutFile.close()
else:
if os.path.isfile(aboutFilename):
os.remove(aboutFilename)
adminNickname = \
getConfigParam(baseDir, 'admin')
if nickname == adminNickname:
if fields.get('editedAbout'):
aboutStr = fields['editedAbout']
aboutFile = open(aboutFilename, "w+")
if aboutFile:
aboutFile.write(aboutStr)
aboutFile.close()
else:
if os.path.isfile(aboutFilename):
os.remove(aboutFilename)
if fields.get('editedTOS'):
TOSStr = fields['editedTOS']
TOSFile = open(TOSFilename, "w+")
if TOSFile:
TOSFile.write(TOSStr)
TOSFile.close()
else:
if os.path.isfile(TOSFilename):
os.remove(TOSFilename)
if fields.get('editedTOS'):
TOSStr = fields['editedTOS']
TOSFile = open(TOSFilename, "w+")
if TOSFile:
TOSFile.write(TOSStr)
TOSFile.close()
else:
if os.path.isfile(TOSFilename):
os.remove(TOSFilename)
# redirect back to the default timeline
if callingDomain.endswith('.onion') and \