forked from indymedia/epicyon
Remove token and salt on account suspend
parent
5f5bb5290d
commit
93008d97b1
|
@ -3154,7 +3154,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if '@' in nickname:
|
if '@' in nickname:
|
||||||
nickname=nickname.split('@')[0]
|
nickname=nickname.split('@')[0]
|
||||||
if moderationButton=='suspend':
|
if moderationButton=='suspend':
|
||||||
suspendAccount(self.server.baseDir,nickname)
|
suspendAccount(self.server.baseDir,nickname,self.server.domain)
|
||||||
if moderationButton=='unsuspend':
|
if moderationButton=='unsuspend':
|
||||||
unsuspendAccount(self.server.baseDir,nickname)
|
unsuspendAccount(self.server.baseDir,nickname)
|
||||||
if moderationButton=='block':
|
if moderationButton=='block':
|
||||||
|
|
|
@ -566,7 +566,7 @@ def unsuspendAccount(baseDir: str,nickname: str) -> None:
|
||||||
suspendedFile.write(suspended)
|
suspendedFile.write(suspended)
|
||||||
suspendedFile.close()
|
suspendedFile.close()
|
||||||
|
|
||||||
def suspendAccount(baseDir: str,nickname: str) -> None:
|
def suspendAccount(baseDir: str,nickname: str,domain: str) -> None:
|
||||||
"""Suspends the given account
|
"""Suspends the given account
|
||||||
"""
|
"""
|
||||||
# Don't suspend the admin
|
# Don't suspend the admin
|
||||||
|
@ -583,6 +583,13 @@ def suspendAccount(baseDir: str,nickname: str) -> None:
|
||||||
if moderator.strip('\n')==nickname:
|
if moderator.strip('\n')==nickname:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
saltFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/.salt'
|
||||||
|
if os.path.isfile(saltFilename):
|
||||||
|
os.remove(saltFilename)
|
||||||
|
tokenFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/.token'
|
||||||
|
if os.path.isfile(tokenFilename):
|
||||||
|
os.remove(tokenFilename)
|
||||||
|
|
||||||
suspendedFilename=baseDir+'/accounts/suspended.txt'
|
suspendedFilename=baseDir+'/accounts/suspended.txt'
|
||||||
if os.path.isfile(suspendedFilename):
|
if os.path.isfile(suspendedFilename):
|
||||||
with open(suspendedFilename, "r") as f:
|
with open(suspendedFilename, "r") as f:
|
||||||
|
|
Loading…
Reference in New Issue