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.
|
Used by the login interface to determine if the authenticator is visible on the login page.
|
||||||
"""
|
"""
|
||||||
validNets = self.visibleFromNets.value.strip()
|
validNets = self.visibleFromNets.value.strip()
|
||||||
if not validNets or net.ipInNetwork(request.ip, validNets):
|
try:
|
||||||
return True
|
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
|
return False
|
||||||
|
|
||||||
def internalAuthenticate(self, username: str, credentials: str, groupsManager: 'auths.GroupsManager') -> bool:
|
def internalAuthenticate(self, username: str, credentials: str, groupsManager: 'auths.GroupsManager') -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user