1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Merge remote-tracking branch 'origin/v2.2'

This commit is contained in:
Adolfo Gómez García 2018-07-31 23:54:10 +02:00
commit 8867ef7036
3 changed files with 7 additions and 6 deletions

View File

@ -54,7 +54,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')
@ -208,6 +208,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

@ -108,7 +108,7 @@ def allowCache(cachePrefix, cacheTimeout, cachingArgs=None, cachingKeyFnc=None):
First arg (self) is 0, so normally cachingArgs are 1, or [1,2,..]
"""
if not cachingKeyFnc:
cachingKeyFnc = lambda(x):''
cachingKeyFnc = lambda x:''
def allowCacheDecorator(fnc):

View File

@ -49,7 +49,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
@ -112,11 +112,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()