forked from indymedia/epicyon
Blocking using actors
parent
f9ccef4f3b
commit
b410de1a7b
20
daemon.py
20
daemon.py
|
@ -2143,11 +2143,31 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if moderationButton=='unsuspend':
|
if moderationButton=='unsuspend':
|
||||||
unsuspendAccount(self.server.baseDir,nickname)
|
unsuspendAccount(self.server.baseDir,nickname)
|
||||||
if moderationButton=='block':
|
if moderationButton=='block':
|
||||||
|
fullBlockDomain=None
|
||||||
|
if moderationText.startswith('http') or \
|
||||||
|
moderationText.startswith('dat'):
|
||||||
|
blockDomain,blockPort=getDomainFromActor(moderationText)
|
||||||
|
fullBlockDomain=blockDomain
|
||||||
|
if blockPort:
|
||||||
|
if blockPort!=80 and blockPort!=443:
|
||||||
|
fullBlockDomain=blockDomain+':'+str(blockPort)
|
||||||
|
if '@' in moderationText:
|
||||||
fullBlockDomain=moderationText.split('@')[1]
|
fullBlockDomain=moderationText.split('@')[1]
|
||||||
|
if fullBlockDomain:
|
||||||
addGlobalBlock(self.server.baseDir, \
|
addGlobalBlock(self.server.baseDir, \
|
||||||
nickname,fullBlockDomain)
|
nickname,fullBlockDomain)
|
||||||
if moderationButton=='unblock':
|
if moderationButton=='unblock':
|
||||||
|
fullBlockDomain=None
|
||||||
|
if moderationText.startswith('http') or \
|
||||||
|
moderationText.startswith('dat'):
|
||||||
|
blockDomain,blockPort=getDomainFromActor(moderationText)
|
||||||
|
fullBlockDomain=blockDomain
|
||||||
|
if blockPort:
|
||||||
|
if blockPort!=80 and blockPort!=443:
|
||||||
|
fullBlockDomain=blockDomain+':'+str(blockPort)
|
||||||
|
if '@' in moderationText:
|
||||||
fullBlockDomain=moderationText.split('@')[1]
|
fullBlockDomain=moderationText.split('@')[1]
|
||||||
|
if fullBlockDomain:
|
||||||
removeGlobalBlock(self.server.baseDir, \
|
removeGlobalBlock(self.server.baseDir, \
|
||||||
nickname,fullBlockDomain)
|
nickname,fullBlockDomain)
|
||||||
if moderationButton=='remove':
|
if moderationButton=='remove':
|
||||||
|
|
|
@ -1069,7 +1069,7 @@ def htmlTimeline(pageNumber: int,itemsPerPage: int,session,baseDir: str, \
|
||||||
tlStr+= \
|
tlStr+= \
|
||||||
'<form method="POST" action="/users/'+nickname+'/moderationaction">' \
|
'<form method="POST" action="/users/'+nickname+'/moderationaction">' \
|
||||||
'<div class="container">\n'+ \
|
'<div class="container">\n'+ \
|
||||||
' <input type="text" placeholder="Nickname or URL..." name="moderationAction" value="">' \
|
' <input type="text" placeholder="Nickname or URL. Block using *@domain or nickname@domain" name="moderationAction" value="">' \
|
||||||
' <input type="submit" title="Remove the above item" name="submitRemove" value="Remove">' \
|
' <input type="submit" title="Remove the above item" name="submitRemove" value="Remove">' \
|
||||||
' <input type="submit" title="Suspend the above account nickname" name="submitSuspend" value="Suspend">' \
|
' <input type="submit" title="Suspend the above account nickname" name="submitSuspend" value="Suspend">' \
|
||||||
' <input type="submit" title="Remove a suspension for an account nickname" name="submitUnsuspend" value="Unsuspend">' \
|
' <input type="submit" title="Remove a suspension for an account nickname" name="submitUnsuspend" value="Unsuspend">' \
|
||||||
|
|
Loading…
Reference in New Issue