Using a better method to get the English language file.
[lhc/web/wiklou.git] / includes / SpecialBlockme.php
index 1ea9f8b..5bfce4e 100644 (file)
@@ -1,17 +1,27 @@
 <?php
-function wfSpecialBlockme()
-{
-       global $wgIP, $wgBlockOpenProxies, $wgOut;
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 
-       if ( !$wgBlockOpenProxies ) {
-               $wgOut->addWikiText( wfMsg( "disabled" ) );
+/**
+ *
+ */
+function wfSpecialBlockme() {
+       global $wgRequest, $wgBlockOpenProxies, $wgOut, $wgProxyKey;
+
+       $ip = wfGetIP();
+       
+       if( !$wgBlockOpenProxies || $wgRequest->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) {
+               $wgOut->addWikiText( wfMsg( 'disabled' ) );
                return;
        }
 
        $blockerName = wfMsg( "proxyblocker" );
        $reason = wfMsg( "proxyblockreason" );
        $success = wfMsg( "proxyblocksuccess" );
-       
+
        $u = User::newFromName( $blockerName );
        $id = $u->idForName();
        if ( !$id ) {
@@ -22,7 +32,7 @@ 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 );