Closed (fixed)
Project:
Webform
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2008 at 23:42 UTC
Updated:
13 Mar 2012 at 01:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
Scott Reynolds commentedMissed a couple in the module file
Comment #2
quicksketchExcellent. Thank you very much. This was fixed in the Drupal 6 version by the advent of the handy ip_address() function in Drupal core, but the Drupal 5 version still pretty clearly has this problem. To increase the consistency between the two versions we should probably make a separate function (probably called "webform_ip_address()") for the Drupal 5 version.
Comment #3
Scott Reynolds commentedThe ip_address() function drupal 6 uses a set of variables to determine which ip address to return (Remote-addr or X-Forwarrded). These variables say "Behind load balancer" and "load balancer ip's are?". That is the bulk of what that function does, is to check to see if load balancer turned on and checks to see if the ip address is contained in the load balancer ip's. So unless you would like to present more settings to the user, perhaps its better to just do it this way.
This patch is like how votingpapi and advance poll do it.
Comment #4
quicksketchI just meant we should abstract the repeated question of
$_SERVER['HTTP_FORWARDED_FOR'] ? $_SERVER['HTTP_FORWARDED_FOR'] : $_SERVER['IP_ADDRESS']into a separate function so that our lines stay mostly the same between the Drupal 5 and 6 versions. I wasn't meaning that we should implement all the functionality of the ip_address() function in Drupal 6.Comment #5
quicksketchEh, considering the End-Of-Life for Drupal 5 is pretty close anyway, I cleaned up this patch and committed it as-is without abstracting it into a webform_ip_address() function. The 2.4 version should be out this weekend.
Comment #7
lostchord commented@#2
I'm running behind HAProxy and although my Apache access logs are showing the correct client address (taken from X-Forwarded-For) the Webforms submissions are showing the client as 127.0.0.1 (in my test environment the proxy is on the same box as the server). So is it really fixed in D6?
cheers
Comment #8
rmcom commentedI would have the same question as lostchord (#7):
Is there a way to feed the user IP address through a proxy or load balancer?
Comment #9
quicksketchRead the contents of your settings.php file. There is a section on configuring Drupal as a reverse proxy.