forked from indymedia/epicyon
Login text
parent
7a4a686d87
commit
37a56aed87
|
@ -1044,10 +1044,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
del self.server.tokensLookup[self.server.tokens[loginNickname]]
|
||||
del self.server.tokens[loginNickname]
|
||||
del self.server.salts[loginNickname]
|
||||
self.send_response(401)
|
||||
self.send_response(303)
|
||||
self.send_header('Content-type', 'text/html; charset=utf-8')
|
||||
self.send_header('Set-Cookie', 'epicyon=; SameSite=Strict')
|
||||
self.end_headers()
|
||||
self.send_header('Location', '/login')
|
||||
self.end_headers()
|
||||
self.server.POSTbusy=False
|
||||
return
|
||||
else:
|
||||
|
|
|
@ -41,7 +41,12 @@ def htmlGetLoginCredentials(loginParams: str,lastLoginTime: int) -> (str,str):
|
|||
def htmlLogin(baseDir: str) -> str:
|
||||
if not os.path.isfile(baseDir+'/accounts/login.png'):
|
||||
copyfile(baseDir+'/img/login.png',baseDir+'/accounts/login.png')
|
||||
# /login?nickname=[username]&password=[password]&remember=on
|
||||
|
||||
loginText='<p>Welcome. Please enter your login details below.</p>'
|
||||
if os.path.isfile(baseDir+'/accounts/login.txt'):
|
||||
with open(baseDir+'/accounts/login.txt', 'r') as file:
|
||||
loginText = '<p>'+file.read()+'</p>'
|
||||
|
||||
loginCSS= \
|
||||
'body, html {' \
|
||||
' height: 100%;' \
|
||||
|
@ -112,7 +117,8 @@ def htmlLogin(baseDir: str) -> str:
|
|||
loginForm+= \
|
||||
' <form method="POST" action="/login">' \
|
||||
' <div class="imgcontainer">' \
|
||||
' <img src="login.png" alt="login image" class="loginimage">' \
|
||||
' <img src="login.png" alt="login image" class="loginimage">'+ \
|
||||
loginText+ \
|
||||
' </div>' \
|
||||
'' \
|
||||
' <div class="container">' \
|
||||
|
|
Loading…
Reference in New Issue