changed no_auth to authentication_disabled in config
This commit is contained in:
@@ -180,21 +180,21 @@ def check_login_simple(username, password):
|
||||
|
||||
class AuthError(Exception):
|
||||
def __init__(self):
|
||||
self.value = 'No Authentication Plugin is enabled and no_auth = false'\
|
||||
' in config!'
|
||||
self.value = 'No Authentication Plugin is enabled and' \
|
||||
' authentication_disabled = false in config!'
|
||||
|
||||
def __str__(self):
|
||||
return repr(self.value)
|
||||
|
||||
|
||||
def check_auth_enabled():
|
||||
no_auth = mg_globals.app_config['no_auth']
|
||||
authentication_disabled = mg_globals.app_config['authentication_disabled']
|
||||
auth_plugin = hook_handle('authentication')
|
||||
|
||||
if no_auth == 'false' and not auth_plugin:
|
||||
if authentication_disabled == 'false' and not auth_plugin:
|
||||
raise AuthError
|
||||
|
||||
if no_auth == 'true' and not auth_plugin:
|
||||
if authentication_disabled == 'true':
|
||||
_log.warning('No authentication is enabled')
|
||||
return False
|
||||
else:
|
||||
@@ -202,7 +202,7 @@ def check_auth_enabled():
|
||||
|
||||
|
||||
def no_auth_logout(request):
|
||||
"""Log out the user if in no_auth mode, but don't delete the messages"""
|
||||
"""Log out the user if authentication_disabled, but don't delete the messages"""
|
||||
if not mg_globals.app.auth and 'user_id' in request.session:
|
||||
del request.session['user_id']
|
||||
request.session.save()
|
||||
|
||||
Reference in New Issue
Block a user