enabled admin/appadmin by default from trusted addresses, thanks Paolo

This commit is contained in:
mdipierro
2020-06-22 22:24:49 -07:00
parent 79f64cbe72
commit cf76978a39
3 changed files with 14 additions and 1 deletions
+7 -1
View File
@@ -6,7 +6,10 @@ from gluon.fileutils import read_file
from gluon.utils import web2py_uuid
from pydal.contrib import portalocker
# ###########################################################
# ## make sure administrator is on localhost or https
# ## make sure administrator is on localhost or https,
# ## or from
# ## gluon.settings.global_settings.trusted_lan_prefix
# ## subnet
# ###########################################################
@@ -22,6 +25,9 @@ else:
if request.is_https:
session.secure()
elif request.env.trusted_lan_prefix and \
request.client.startswith(request.env.trusted_lan_prefix):
request.is_local = True
elif not request.is_local and not DEMO_MODE:
raise HTTP(200, T('Admin is disabled because insecure channel'))