Merge "ApiOptions: set form field parent earlier"
[lhc/web/wiklou.git] / includes / specials / SpecialUpload.php
index 2754b13..09111f6 100644 (file)
@@ -180,6 +180,11 @@ class SpecialUpload extends SpecialPage {
                        throw new UserBlockedError( $user->getBlock() );
                }
 
+               // Global blocks
+               if ( $user->isBlockedGlobally() ) {
+                       throw new UserBlockedError( $user->getGlobalBlock() );
+               }
+
                # Check whether we actually want to allow changing stuff
                $this->checkReadOnly();
 
@@ -362,8 +367,11 @@ class SpecialUpload extends SpecialPage {
 
                $sessionKey = $this->mUpload->stashSession();
 
+               // Add styles for the warning, reused from the live preview
+               $this->getOutput()->addModuleStyles( 'mediawiki.special.upload' );
+
                $warningHtml = '<h2>' . $this->msg( 'uploadwarning' )->escaped() . "</h2>\n"
-                       . '<div class="warningbox"><ul>';
+                       . '<div class="mw-destfile-warning"><ul>';
                foreach ( $warnings as $warning => $args ) {
                        if ( $warning == 'badfilename' ) {
                                $this->mDesiredDestName = Title::makeTitle( NS_FILE, $args )->getText();
@@ -622,7 +630,8 @@ class SpecialUpload extends SpecialPage {
                        return false;
                } else {
                        // New page should get watched if that's our option.
-                       return $this->getUser()->getOption( 'watchcreations' );
+                       return $this->getUser()->getOption( 'watchcreations' ) ||
+                               $this->getUser()->getOption( 'watchuploads' );
                }
        }