* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( "ApiBase.php" );
-}
-
/**
* API module that facilitates the blocking of users. Requires API write mode
* to be enabled.
$params = $this->extractRequestParams();
if ( $params['gettoken'] ) {
- $res['blocktoken'] = $user->getEditToken( '', $this->getMain()->getRequest() );
+ $res['blocktoken'] = $user->getEditToken();
$this->getResult()->addValue( null, $this->getModuleName(), $res );
return;
}
}
# bug 15810: blocked admins should have limited access here
if ( $user->isBlocked() ) {
- $status = SpecialBlock::checkUnblockSelf( $params['user'] );
+ $status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
$this->dieUsageMsg( array( $status ) );
}
'Confirm' => true,
);
- $retval = SpecialBlock::processForm( $data );
+ $retval = SpecialBlock::processForm( $data, $this->getContext() );
if ( $retval !== true ) {
// We don't care about multiple errors, just report one of them
$this->dieUsageMsg( $retval );
}
public function getHelpUrls() {
- return 'http://www.mediawiki.org/wiki/API:Block';
+ return 'https://www.mediawiki.org/wiki/API:Block';
}
public function getVersion() {