forked from WikibaseSolutions/PageEditRestrictions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PageEditRestrictions.php
40 lines (34 loc) · 1.17 KB
/
PageEditRestrictions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* This extension allows certain pages to be restricted to be edited only by certain users.
*
* @version 1.0.0
*
* @author Pim Bax (Joeytje50)
*/
// Ensure that the script cannot be executed outside of MediaWiki
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This is an extension to MediaWiki and cannot be run standalone.' );
}
// Register extension with MediaWiki
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'PageEditRestrictions',
'author' => array(
'Pim Bax'
),
'version' => '1.0.0',
'url' => 'https://www.mediawiki.org/wiki/Extension:PageEditRestrictions',
'descriptionmsg' => 'pageeditrestrictions-desc',
'license-name' => 'GPL-3.0+'
);
// Load extension's class
$wgAutoloadClasses['PageEditRestrictions'] = __DIR__ . '/PageEditRestrictions.class.php';
// Register extension messages
$wgMessagesDirs['PageEditRestrictions'] = __DIR__ . '/i18n';
$wgExtensionMessagesFiles['PageEditRestrictions'] = __DIR__ . '/PageEditRestrictions.i18n.php';
// Add user permission
$wgAvailableRights[] = 'editrestrictedpages';
$wgGroupPermissions['sysop']['editrestrictedpages'] = true;
// Register hook
$wgHooks['userCan'][] = 'PageEditRestrictions::onUserCan';