Per CR on r58079, add a permission check for 'reupload-shared' to
authorAlex Z <mrzman@users.mediawiki.org>
Sat, 26 Dec 2009 21:56:05 +0000 (21:56 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Sat, 26 Dec 2009 21:56:05 +0000 (21:56 +0000)
Title::isValidMoveOperation when moving a file over one on a shared repo

includes/Title.php

index 4efd6d1..89b01f4 100644 (file)
@@ -2686,7 +2686,10 @@ class Title {
                                if( !File::checkExtensionCompatibility( $file, $nt->getDBkey() ) ) {
                                        $errors[] = array('imagetypemismatch');
                                }
+                       } elseif( !$wgUser->isAllowed( 'reupload-shared' ) && wfFindFile( $nt ) ) {
+                               $errors[] = array( 'file-exists-sharedrepo' );
                        }
+                       
                }
 
                if ( $auth ) {