Reject actual logins when admin is disabled.
This commit is contained in:
parent
5d811e3a51
commit
afc90a05cc
@ -11,6 +11,7 @@ include isso/js/count.dev.js
|
|||||||
include isso/defaults.ini
|
include isso/defaults.ini
|
||||||
|
|
||||||
include isso/templates/admin.html
|
include isso/templates/admin.html
|
||||||
|
include isso/templates/disabled.html
|
||||||
include isso/templates/login.html
|
include isso/templates/login.html
|
||||||
include isso/css/admin.css
|
include isso/css/admin.css
|
||||||
include isso/css/isso.css
|
include isso/css/isso.css
|
||||||
|
@ -1067,6 +1067,8 @@ class API(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def login(self, env, req):
|
def login(self, env, req):
|
||||||
|
if not self.isso.conf.getboolean("admin", "enabled"):
|
||||||
|
return render_template('disabled.html')
|
||||||
data = req.form
|
data = req.form
|
||||||
password = self.isso.conf.get("admin", "password")
|
password = self.isso.conf.get("admin", "password")
|
||||||
if data['password'] and data['password'] == password:
|
if data['password'] and data['password'] == password:
|
||||||
@ -1088,8 +1090,7 @@ class API(object):
|
|||||||
def admin(self, env, req):
|
def admin(self, env, req):
|
||||||
isso_host_script = self.isso.conf.get("server", "public-endpoint") or local.host
|
isso_host_script = self.isso.conf.get("server", "public-endpoint") or local.host
|
||||||
if not self.isso.conf.getboolean("admin", "enabled"):
|
if not self.isso.conf.getboolean("admin", "enabled"):
|
||||||
return render_template(
|
return render_template('disabled.html')
|
||||||
'disabled.html', isso_host_script=isso_host_script)
|
|
||||||
try:
|
try:
|
||||||
data = self.isso.unsign(req.cookies.get('admin-session', ''),
|
data = self.isso.unsign(req.cookies.get('admin-session', ''),
|
||||||
max_age=60 * 60 * 24)
|
max_age=60 * 60 * 24)
|
||||||
|
@ -63,7 +63,7 @@ gravatar-url = https://www.gravatar.com/avatar/{}?d=identicon
|
|||||||
enabled = false
|
enabled = false
|
||||||
|
|
||||||
# Admin access password
|
# Admin access password
|
||||||
_password = please_choose_a_strong_password
|
password = please_choose_a_strong_password
|
||||||
|
|
||||||
[moderation]
|
[moderation]
|
||||||
# enable comment moderation queue. This option only affects new comments.
|
# enable comment moderation queue. This option only affects new comments.
|
||||||
|
Loading…
Reference in New Issue
Block a user