forked from indymedia/epicyon
For news instances divert to the front page if not logged in
parent
4f0353199c
commit
35c39107e9
11
daemon.py
11
daemon.py
|
@ -7750,6 +7750,11 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
divertToLoginScreen = False
|
divertToLoginScreen = False
|
||||||
|
|
||||||
if divertToLoginScreen and not authorized:
|
if divertToLoginScreen and not authorized:
|
||||||
|
divertPath = '/login'
|
||||||
|
if self.server.newsInstance:
|
||||||
|
# for news instances if not logged in then show the
|
||||||
|
# front page
|
||||||
|
divertPath = '/users/news'
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: divertToLoginScreen=' +
|
print('DEBUG: divertToLoginScreen=' +
|
||||||
str(divertToLoginScreen))
|
str(divertToLoginScreen))
|
||||||
|
@ -7757,16 +7762,16 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('DEBUG: path=' + path)
|
print('DEBUG: path=' + path)
|
||||||
if callingDomain.endswith('.onion') and onionDomain:
|
if callingDomain.endswith('.onion') and onionDomain:
|
||||||
self._redirect_headers('http://' +
|
self._redirect_headers('http://' +
|
||||||
onionDomain + '/login',
|
onionDomain + divertPath,
|
||||||
None, callingDomain)
|
None, callingDomain)
|
||||||
elif callingDomain.endswith('.i2p') and i2pDomain:
|
elif callingDomain.endswith('.i2p') and i2pDomain:
|
||||||
self._redirect_headers('http://' +
|
self._redirect_headers('http://' +
|
||||||
i2pDomain + '/login',
|
i2pDomain + divertPath,
|
||||||
None, callingDomain)
|
None, callingDomain)
|
||||||
else:
|
else:
|
||||||
self._redirect_headers(httpPrefix + '://' +
|
self._redirect_headers(httpPrefix + '://' +
|
||||||
domainFull +
|
domainFull +
|
||||||
'/login', None, callingDomain)
|
divertPath, None, callingDomain)
|
||||||
self._benchmarkGETtimings(GETstartTime, GETtimings,
|
self._benchmarkGETtimings(GETstartTime, GETtimings,
|
||||||
'robots txt',
|
'robots txt',
|
||||||
'show login screen')
|
'show login screen')
|
||||||
|
|
Loading…
Reference in New Issue