includes/ProxyTools.php File Reference

Functions for dealing with proxies. More...

Go to the source code of this file.

Functions

 wfGetForwardedFor ()
 Extracts the XFF string from the request header Checks first for "X-Forwarded-For", then "Client-ip" Note: headers are spoofable.
 wfGetAgent ()
 Returns the browser/OS data from the request header Note: headers are spoofable.
 wfGetIP ()
 Work out the IP address based on various globals For trusted proxies, use the XFF client IP (first of the chain).
 wfIsTrustedProxy ($ip)
 Checks if an IP is a trusted proxy providor Useful to tell if X-Fowarded-For data is possibly bogus Squid cache servers for the site and AOL are whitelisted.
 wfProxyCheck ()
 Forks processes to scan the originating IP for an open proxy server MemCached can be used to skip IPs that have already been scanned.
 wfParseCIDR ($range)
 Convert a network specification in CIDR notation to an integer network and a number of bits.
 wfIsLocallyBlockedProxy ($ip)
 Check if an IP address is in the local proxy list.


Detailed Description

Functions for dealing with proxies.

Definition in file ProxyTools.php.


Function Documentation

wfGetAgent (  ) 

Returns the browser/OS data from the request header Note: headers are spoofable.

Returns:
string

Definition at line 44 of file ProxyTools.php.

References $_SERVER.

wfGetForwardedFor (  ) 

Extracts the XFF string from the request header Checks first for "X-Forwarded-For", then "Client-ip" Note: headers are spoofable.

Returns:
string

Definition at line 13 of file ProxyTools.php.

References $_SERVER.

Referenced by wfGetIP().

wfGetIP (  ) 

wfIsLocallyBlockedProxy ( ip  ) 

Check if an IP address is in the local proxy list.

Returns:
bool

Definition at line 188 of file ProxyTools.php.

References $fname, $wgProxyList, wfProfileIn(), and wfProfileOut().

Referenced by User::getBlockedStatus().

wfIsTrustedProxy ( ip  ) 

Checks if an IP is a trusted proxy providor Useful to tell if X-Fowarded-For data is possibly bogus Squid cache servers for the site and AOL are whitelisted.

Parameters:
string $ip
Returns:
bool

Definition at line 122 of file ProxyTools.php.

References $wgSquidServers, $wgSquidServersNoPurge, and wfRunHooks().

Referenced by wfGetIP().

wfParseCIDR ( range  ) 

Convert a network specification in CIDR notation to an integer network and a number of bits.

Returns:
array(string, int)

Definition at line 180 of file ProxyTools.php.

References IP::parseCIDR().

wfProxyCheck (  ) 

Forks processes to scan the originating IP for an open proxy server MemCached can be used to skip IPs that have already been scanned.

Definition at line 140 of file ProxyTools.php.

References $title, $url, $wgBlockOpenProxies, $wgMemc, $wgProxyKey, $wgProxyMemcExpiry, $wgProxyPorts, $wgProxyScriptPath, SpecialPage::getTitleFor(), wfGetIP(), and wfMemcKey().

Referenced by EditPage::initialiseForm().


Generated on Sat Sep 5 02:08:24 2009 for MediaWiki by  doxygen 1.5.9