* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( "ApiBase.php" );
-}
-
/**
* @ingroup API
*/
}
public function execute() {
- global $wgUser;
$params = $this->extractRequestParams();
- if ( !$wgUser->isAllowed( 'undelete' ) ) {
+ if ( !$this->getUser()->isAllowed( 'undelete' ) ) {
$this->dieUsageMsg( 'permdenied-undelete' );
}
- if ( $wgUser->isBlocked() ) {
+ if ( $this->getUser()->isBlocked() ) {
$this->dieUsageMsg( 'blockedtext' );
}
if ( $retval[1] ) {
wfRunHooks( 'FileUndeleteComplete',
- array( $titleObj, array(), $wgUser, $params['reason'] ) );
+ array( $titleObj, array(), $this->getUser(), $params['reason'] ) );
}
$this->setWatch( $params['watchlist'], $titleObj );
return '';
}
- protected function getExamples() {
+ public function getExamples() {
return array(
'api.php?action=undelete&title=Main%20Page&token=123ABC&reason=Restoring%20main%20page',
'api.php?action=undelete&title=Main%20Page&token=123ABC×tamps=20070703220045|20070702194856'
}
public function getHelpUrls() {
- return 'http://www.mediawiki.org/wiki/API:Undelete';
+ return 'https://www.mediawiki.org/wiki/API:Undelete';
}
public function getVersion() {