MediaWiki  REL1_22
ProxyTools.php
Go to the documentation of this file.
00001 <?php
00030 function wfGetForwardedFor() {
00031     wfDeprecated( __METHOD__, '1.19' );
00032     global $wgRequest;
00033     return $wgRequest->getHeader( 'X-Forwarded-For' );
00034 }
00035 
00043 function wfGetAgent() {
00044     wfDeprecated( __METHOD__, '1.18' );
00045     global $wgRequest;
00046     return $wgRequest->getHeader( 'User-Agent' );
00047 }
00048 
00056 function wfGetIP() {
00057     wfDeprecated( __METHOD__, '1.19' );
00058     global $wgRequest;
00059     return $wgRequest->getIP();
00060 }
00061 
00070 function wfIsTrustedProxy( $ip ) {
00071     $trusted = wfIsConfiguredProxy( $ip );
00072     wfRunHooks( 'IsTrustedProxy', array( &$ip, &$trusted ) );
00073     return $trusted;
00074 }
00075 
00081 function wfIsConfiguredProxy( $ip ) {
00082     global $wgSquidServers, $wgSquidServersNoPurge;
00083     $trusted = in_array( $ip, $wgSquidServers ) ||
00084         in_array( $ip, $wgSquidServersNoPurge );
00085     return $trusted;
00086 }