* Add option to include templates in Special:Export.
[lhc/web/wiklou.git] / includes / SpecialBlockme.php
index 6721d26..e68f942 100644 (file)
@@ -1,21 +1,21 @@
 <?php
 /**
  *
- * @package MediaWiki
- * @subpackage SpecialPage
+ * @addtogroup SpecialPage
  */
 
 /**
  *
  */
-function wfSpecialBlockme()
-{
-       global $wgIP, $wgBlockOpenProxies, $wgOut, $wgProxyKey;
+function wfSpecialBlockme() {
+       global $wgRequest, $wgBlockOpenProxies, $wgOut, $wgProxyKey;
 
-       if ( !$wgBlockOpenProxies || $_REQUEST['ip'] != md5( $wgIP . $wgProxyKey ) ) {
-               $wgOut->addWikiText( wfMsg( "disabled" ) );
+       $ip = wfGetIP();
+       
+       if( !$wgBlockOpenProxies || $wgRequest->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) {
+               $wgOut->addWikiText( wfMsg( 'proxyblocker-disabled' ) );
                return;
-       }       
+       }
 
        $blockerName = wfMsg( "proxyblocker" );
        $reason = wfMsg( "proxyblockreason" );
@@ -31,9 +31,9 @@ function wfSpecialBlockme()
                $id = $u->getID();
        }
 
-       $block = new Block( $wgIP, 0, $id, $reason, wfTimestampNow() );
+       $block = new Block( $ip, 0, $id, $reason, wfTimestampNow() );
        $block->insert();
 
        $wgOut->addWikiText( $success );
 }
-?>
+