Merge remote-tracking branch 'origin/v3.0'

This commit is contained in:
Adolfo Gómez García 2021-05-19 12:20:11 +02:00
commit 12b8354a8e

View File

@ -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