Implement access restriction for special page.

This commit is contained in:
Daniel Kraus
2014-06-03 16:50:57 +02:00
parent 6f25d469ed
commit 3e850f2781
2 changed files with 14 additions and 1 deletions

View File

@ -2,10 +2,19 @@
class SpecialLinkTitles extends SpecialPage {
function __construct() {
parent::__construct('LinkTitles');
// the second parameter in the following function call ensures that only
// users who have the 'linktitles-batch' right get to see this page (by
// default, this are all sysop users).
parent::__construct('LinkTitles', 'linktitles-batch');
}
function execute($par) {
// Prevent non-authorized users from executing the batch processing.
if ( !$this->userCanExecute( $this->getUser() ) ) {
$this->displayRestrictionError();
return;
}
$request = $this->getRequest();
$output = $this->getOutput();
$this->setHeaders();