[minor] fix ip restrictions to use forwarded for header as well

This commit is contained in:
Pratik Vyas 2013-11-06 12:06:54 +05:30
parent 26d4af38b5
commit 2f52fe974b

View file

@ -171,7 +171,7 @@ class LoginManager:
ip_list = [i.strip() for i in ip_list]
for ip in ip_list:
if webnotes.get_request_header('REMOTE_ADDR', '').startswith(ip):
if webnotes.get_request_header('REMOTE_ADDR', '').startswith(ip) or webnotes.get_request_header('HTTP_X_FORWARDED_FOR', '').startswith(ip):
return
webnotes.msgprint('Not allowed from this IP Address')