forked from shaba/openuds
Fixed check of ip
This commit is contained in:
parent
5084fec43f
commit
1fba4d3f9f
@ -102,8 +102,11 @@ class IPAuth(auths.Authenticator):
|
||||
Used by the login interface to determine if the authenticator is visible on the login page.
|
||||
"""
|
||||
validNets = self.visibleFromNets.value.strip()
|
||||
try:
|
||||
if not validNets or net.ipInNetwork(request.ip, validNets):
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error('Invalid network for IP auth: %s', e)
|
||||
return False
|
||||
|
||||
def internalAuthenticate(self, username: str, credentials: str, groupsManager: 'auths.GroupsManager') -> bool:
|
||||
|
Loading…
Reference in New Issue
Block a user