* (bug 6579) Fixed protecting images from uploading only
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Wed, 4 Nov 2009 12:55:00 +0000 (12:55 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Wed, 4 Nov 2009 12:55:00 +0000 (12:55 +0000)
* Added upload by default to $wgRestrictionTypes

Also requires MessagesEn.php accidently committed in r58536

RELEASE-NOTES
includes/DefaultSettings.php
includes/ProtectionForm.php
maintenance/language/messages.inc
skins/common/protect.js

index 488f92f..8c10923 100644 (file)
@@ -96,6 +96,7 @@ Hopefully we will remove this configuration var soon)
 * $wgEnableHtmlDiff has been removed
 * (bug 3340) $wgBlockCIDRLimit added (default: 16) to configure the low end of
   CIDR ranges for blocking
+* Added upload by default to $wgRestrictionTypes
 
 === New features in 1.16 ===
 
@@ -617,6 +618,7 @@ Hopefully we will remove this configuration var soon)
 * (bug 19859) Removed experimental HTMLDiff feature
 * Removed section edit links in edit conflict form
 * Allow SpecialActiveusers to work on non-MySQL databases
+* (bug 6579) Fixed protecting images from uploading only 
 
 == API changes in 1.16 ==
 
index adcc1a5..db1106a 100644 (file)
@@ -1452,7 +1452,7 @@ $wgGroupsRemoveFromSelf = array();
  * You probably shouldn't change this.
  * Translated through restriction-* messages.
  */
-$wgRestrictionTypes = array( 'edit', 'move' );
+$wgRestrictionTypes = array( 'edit', 'move', 'upload' );
 
 /**
  * Rights which can be required for each protection level (via action=protect)
index e6b7dbe..4a32ecd 100644 (file)
@@ -318,6 +318,10 @@ class ProtectionForm {
                        Xml::openElement( 'tbody' );
 
                foreach( $this->mRestrictions as $action => $selected ) {
+                       // Special case: apply upload protection only on images
+                       if ( $action == 'upload' && $this->mTitle->getNamespace() != NS_FILE )
+                               continue;
+                       
                        /* Not all languages have V_x <-> N_x relation */
                        $msg = wfMsg( 'restriction-' . $action );
                        if( wfEmptyMsg( 'restriction-' . $action, $msg ) ) {
@@ -547,8 +551,8 @@ class ProtectionForm {
                }
                $script .= "[" . implode(',',$CascadeableLevels) . "];\n";
                $options = (object)array(
-                       'tableId' => 'mw-protect-table-move',
-                       'labelText' => wfMsg( 'protect-unchain' ),
+                       'tableId' => 'mwProtectSet',
+                       'labelText' => wfMsg( 'protect-unchain-permissions' ),
                        'numTypes' => count($this->mApplicableTypes),
                        'existingMatch' => 1 == count( array_unique( $this->mExistingExpiry ) ),
                );
index dabbe26..0e01ed6 100644 (file)
@@ -1751,7 +1751,7 @@ $wgMessageStructure = array(
                'protectexpiry',
                'protect_expiry_invalid',
                'protect_expiry_old',
-               'protect-unchain',
+               'protect-unchain-permissions',
                'protect-text',
                'protect-locked-blocked',
                'protect-locked-dblock',
index d9650c8..e037f08 100644 (file)
@@ -22,7 +22,7 @@ var ProtectionForm = {
                
                var boxbody = box.getElementsByTagName('tbody')[0]
                var row = document.createElement( 'tr' );
-               boxbody.insertBefore( row, boxbody.firstChild );
+               boxbody.insertBefore( row, boxbody.firstChild.nextSibling );
 
                this.existingMatch = opts.existingMatch;