projects
/
horde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
71a04e9
)
Add getIPAddress() (Bug #8620).
author
Jan Schneider
<jan@horde.org>
Thu, 1 Oct 2009 13:37:37 +0000
(15:37 +0200)
committer
Jan Schneider
<jan@horde.org>
Thu, 1 Oct 2009 13:37:53 +0000
(15:37 +0200)
framework/Browser/lib/Horde/Browser.php
patch
|
blob
|
history
diff --git
a/framework/Browser/lib/Horde/Browser.php
b/framework/Browser/lib/Horde/Browser.php
index
bedb46d
..
4520c1d
100644
(file)
--- a/
framework/Browser/lib/Horde/Browser.php
+++ b/
framework/Browser/lib/Horde/Browser.php
@@
-961,6
+961,18
@@
class Horde_Browser
}
/**
+ * Returns the IP address of the client.
+ *
+ * @return string The client IP address.
+ */
+ public function getIPAddress()
+ {
+ return empty($_SERVER['HTTP_X_FORWARDED_FOR'])
+ ? $_SERVER['REMOTE_ADDR']
+ : $_SERVER['HTTP_X_FORWARDED_FOR'];
+ }
+
+ /**
* Determines if files can be uploaded to the system.
*
* @return integer If uploads allowed, returns the maximum size of the