5 * @subpackage SpecialPage
11 function wfSpecialBlockme()
13 global $wgIP, $wgBlockOpenProxies, $wgOut, $wgProxyKey;
15 if ( !$wgBlockOpenProxies ||
$_REQUEST['ip'] != md5( $wgIP . $wgProxyKey ) ) {
16 $wgOut->addWikiText( wfMsg( "disabled" ) );
20 $blockerName = wfMsg( "proxyblocker" );
21 $reason = wfMsg( "proxyblockreason" );
22 $success = wfMsg( "proxyblocksuccess" );
24 $u = User
::newFromName( $blockerName );
25 $id = $u->idForName();
27 $u = User
::newFromName( $blockerName );
29 $u->setPassword( bin2hex( mt_rand(0, 0x7fffffff ) ) );
34 $block = new Block( $wgIP, 0, $id, $reason, wfTimestampNow() );
37 $wgOut->addWikiText( $success );