Fixed string for "access denied" on logon

This commit is contained in:
Adolfo Gómez García
2018-07-26 12:52:08 +02:00
parent 4b75be2f02
commit cce00adc51
2 changed files with 6 additions and 5 deletions

View File

@ -53,7 +53,7 @@ from uds.models import User
import logging
import six
__updated__ = '2018-06-27'
__updated__ = '2018-07-26'
logger = logging.getLogger(__name__)
authLogger = logging.getLogger('authLog')
@ -207,6 +207,7 @@ def authenticate(username, password, authenticator, useInternalAuthenticate=Fals
# If do not have any valid group
if gm.hasValidGroups() is False:
logger.info('User {} has been authenticated, but he does not belongs to any UDS know group')
return None
return __registerUser(authenticator, authInstance, username)

View File

@ -50,7 +50,7 @@ import uds.web.errors as errors
import logging
logger = logging.getLogger(__name__)
__updated__ = '2018-06-27'
__updated__ = '2018-07-26'
# Allow cross-domain login
@ -113,11 +113,11 @@ def login(request, tag=None):
logger.debug('User: {}'.format(user))
if user is None:
logger.debug("Invalid credentials for user {0}".format(userName))
logger.debug("Invalid user {0} (access denied)".format(userName))
tries += 1
cache.put(cacheKey, tries, GlobalConfig.LOGIN_BLOCK.getInt())
form.add_error(None, ugettext('Invalid credentials'))
authLogLogin(request, authenticator, userName, 'Invalid credentials')
form.add_error(None, ugettext('Access denied'))
authLogLogin(request, authenticator, userName, 'Access denied (user not allowed by UDS)')
else:
request.session.cycle_key()