(bug 26574) Added 'upload' to $wgRestrictionTypes, allowing upload protected pages to be queried via the API and Special:ProtectedPages, and allowing disabling upload protection by removing it from $wgRestrictionTypes.
This commit is contained in:
parent
bfce19b61b
commit
718ff89310
4 changed files with 12 additions and 6 deletions
|
|
@ -56,6 +56,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
|
|||
link has a % sign in it.
|
||||
* (bug 26412) Search results headers no longer show a bogus edit link.
|
||||
* (bug 26540) Fixed wrong call to applyPatch in MysqlUpdater
|
||||
* (bug 26574) Added 'upload' to $wgRestrictionTypes, allowing upload protected
|
||||
pages to be queried via the API and Special:ProtectedPages, and allowing
|
||||
disabling upload protection by removing it from $wgRestrictionTypes.
|
||||
|
||||
=== API changes in 1.18 ===
|
||||
* (bug 26339) Throw warning when truncating an overlarge API result
|
||||
|
|
|
|||
|
|
@ -3344,8 +3344,10 @@ $wgGroupsRemoveFromSelf = array();
|
|||
* Set of available actions that can be restricted via action=protect
|
||||
* You probably shouldn't change this.
|
||||
* Translated through restriction-* messages.
|
||||
* Title::getRestrictionTypes() will remove restrictions that are not
|
||||
* applicable to a specific title (upload currently)
|
||||
*/
|
||||
$wgRestrictionTypes = array( 'edit', 'move' );
|
||||
$wgRestrictionTypes = array( 'edit', 'move', 'upload' );
|
||||
|
||||
/**
|
||||
* Rights which can be required for each protection level (via action=protect)
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ class Skin extends Linker {
|
|||
'wgCategories' => $wgOut->getCategories(),
|
||||
'wgBreakFrames' => $wgOut->getFrameOptions() == 'DENY',
|
||||
);
|
||||
foreach ( $wgRestrictionTypes as $type ) {
|
||||
foreach ( $wgTitle->getRestrictionTypes() as $type ) {
|
||||
$vars['wgRestriction' . ucfirst( $type )] = $wgTitle->getRestrictions( $type );
|
||||
}
|
||||
if ( $wgUseAjax && $wgEnableMWSuggest && !$wgUser->getOption( 'disablesuggest', false ) ) {
|
||||
|
|
|
|||
|
|
@ -4116,14 +4116,15 @@ class Title {
|
|||
*/
|
||||
public function getRestrictionTypes() {
|
||||
global $wgRestrictionTypes;
|
||||
|
||||
$types = $this->exists() ? $wgRestrictionTypes : array( 'create' );
|
||||
|
||||
if ( $this->getNamespace() == NS_FILE ) {
|
||||
$types[] = 'upload';
|
||||
if ( $this->getNamespace() != NS_FILE && in_array( 'upload', $types ) ) {
|
||||
$types = array_diff( $types, array( 'upload' ) );
|
||||
}
|
||||
|
||||
|
||||
wfRunHooks( 'TitleGetRestrictionTypes', array( $this, &$types ) );
|
||||
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue