From 95146b15eb4759e87ace031543464b7bd5d51337 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 13 Oct 2020 10:58:06 +0100 Subject: [PATCH] Tidying --- daemon.py | 5 ----- webinterface.py | 52 +++++++++++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/daemon.py b/daemon.py index 98377fd37..c5a815729 100644 --- a/daemon.py +++ b/daemon.py @@ -8288,11 +8288,6 @@ class PubServer(BaseHTTPRequestHandler): return False def do_GET(self): - # don't allow access to system actors - if self.path == '/users/news' or self.path == '/users/inbox': - self._400() - return - callingDomain = self.server.domainFull if self.headers.get('Host'): callingDomain = self.headers['Host'] diff --git a/webinterface.py b/webinterface.py index 4b950af01..0e822083e 100644 --- a/webinterface.py +++ b/webinterface.py @@ -3224,6 +3224,14 @@ def htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int, return timelineStr +def isSystemAccount(nickname: str) -> bool: + """Returns true if the given nickname is a system account + """ + if nickname == 'news' or nickname == 'inbox': + return True + return False + + def htmlProfile(defaultTimeline: str, recentPostsCache: {}, maxRecentPosts: int, translate: {}, projectVersion: str, @@ -3296,7 +3304,7 @@ def htmlProfile(defaultTimeline: str, PGPfingerprint or emailAddress: donateSection = '
\n' donateSection += '
\n' - if donateUrl: + if donateUrl and not isSystemAccount(nickname): donateSection += \ '

' - profileStr += \ - ' ' + \ - '' - profileStr += \ - ' ' + \ - '' - profileStr += \ - ' ' + \ - '' - profileStr += \ - ' ' + \ - '' - profileStr += \ - ' ' + \ - '' + if not isSystemAccount(nickname): + profileStr += \ + ' ' + \ + '' + profileStr += \ + ' ' + \ + '' + profileStr += \ + ' ' + \ + '' + profileStr += \ + ' ' + \ + '' + profileStr += \ + ' ' + \ + '' profileStr += editProfileStr + logoutStr profileStr += '

' profileStr += '
'