forked from shaba/openuds
Merge remote-tracking branch 'origin/v3.0'
This commit is contained in:
commit
12b8354a8e
@ -48,15 +48,15 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class IPAuth(auths.Authenticator):
|
||||
acceptProxy = gui.CheckBoxField(
|
||||
label=_('Accept proxy'),
|
||||
order=3,
|
||||
tooltip=_(
|
||||
'If checked, requests via proxy will get FORWARDED ip address'
|
||||
' (take care with this bein checked, can take internal IP addresses from internet)'
|
||||
),
|
||||
tab=gui.ADVANCED_TAB
|
||||
)
|
||||
#acceptProxy = gui.CheckBoxField(
|
||||
# label=_('Accept proxy'),
|
||||
# order=3,
|
||||
# tooltip=_(
|
||||
# 'If checked, requests via proxy will get FORWARDED ip address'
|
||||
# ' (take care with this bein checked, can take internal IP addresses from internet)'
|
||||
# ),
|
||||
# tab=gui.ADVANCED_TAB
|
||||
#)
|
||||
|
||||
typeName = _('IP Authenticator')
|
||||
typeType = 'IPAuth'
|
||||
@ -71,7 +71,8 @@ class IPAuth(auths.Authenticator):
|
||||
blockUserOnLoginFailures = False
|
||||
|
||||
def getIp(self) -> str:
|
||||
ip = getRequest().ip_proxy if self.acceptProxy.isTrue() else getRequest().ip # pylint: disable=maybe-no-member
|
||||
# ip = getRequest().ip_proxy if self.acceptProxy.isTrue() else getRequest().ip # pylint: disable=maybe-no-member
|
||||
ip = getRequest().ip # Proxy is identified by UDS
|
||||
logger.debug('Client IP: %s', ip)
|
||||
return ip
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user