More verbose

main
Bob Mottram 2020-10-13 12:13:32 +01:00
parent b0267fb39a
commit e64620a876
3 changed files with 13 additions and 10 deletions

View File

@ -164,6 +164,7 @@ from shares import getSharesFeedForPerson
from shares import addShare from shares import addShare
from shares import removeShare from shares import removeShare
from shares import expireShares from shares import expireShares
from utils import isSystemAccount
from utils import setConfigParam from utils import setConfigParam
from utils import getConfigParam from utils import getConfigParam
from utils import removeIdEnding from utils import removeIdEnding
@ -1240,8 +1241,9 @@ class PubServer(BaseHTTPRequestHandler):
loginNickname, loginPassword, register = \ loginNickname, loginPassword, register = \
htmlGetLoginCredentials(loginParams, self.server.lastLoginTime) htmlGetLoginCredentials(loginParams, self.server.lastLoginTime)
if loginNickname: if loginNickname:
if loginNickname == 'news' or loginNickname == 'inbox': if isSystemAccount(loginNickname):
print('Invalid username login: ' + loginNickname) print('Invalid username login: ' + loginNickname +
' (system account)')
self._clearLoginDetails(loginNickname, callingDomain) self._clearLoginDetails(loginNickname, callingDomain)
self.server.POSTbusy = False self.server.POSTbusy = False
return return

View File

@ -19,6 +19,14 @@ from calendar import monthrange
from followingCalendar import addPersonToCalendar from followingCalendar import addPersonToCalendar
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 createConfig(baseDir: str) -> None: def createConfig(baseDir: str) -> None:
"""Creates a configuration file """Creates a configuration file
""" """

View File

@ -25,6 +25,7 @@ from ssb import getSSBAddress
from tox import getToxAddress from tox import getToxAddress
from matrix import getMatrixAddress from matrix import getMatrixAddress
from donate import getDonationUrl from donate import getDonationUrl
from utils import isSystemAccount
from utils import removeIdEnding from utils import removeIdEnding
from utils import getProtocolPrefixes from utils import getProtocolPrefixes
from utils import searchBoxPosts from utils import searchBoxPosts
@ -3224,14 +3225,6 @@ def htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
return timelineStr 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, def htmlProfile(defaultTimeline: str,
recentPostsCache: {}, maxRecentPosts: int, recentPostsCache: {}, maxRecentPosts: int,
translate: {}, projectVersion: str, translate: {}, projectVersion: str,