Use new get_client_ip() function instead of using REMOTE_ADDR.

This commit is contained in:
Magnus Hagander
2010-06-17 14:56:26 +02:00
parent 6c1c4213d5
commit 2942c2832a
2 changed files with 4 additions and 7 deletions

View File

@ -13,6 +13,7 @@ import cPickle as pickle
from pgweb.util.decorators import ssl_required, nocache
from pgweb.util.contexts import NavContext
from pgweb.util.helpers import simple_form, PgXmlHelper
from pgweb.util.misc import get_client_ip
from models import *
from forms import *
@ -90,7 +91,7 @@ def ftpbrowser(request, subpath):
def _get_numeric_ip(request):
try:
ip = request.META['REMOTE_ADDR']
ip = get_client_ip(request)
p = ip.split('.')
return int(p[0])*16777216 + int(p[1])*65536 + int(p[2])*256 + int(p[3])
except: