Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/285292
Change subject: Simplify GlobalBlocking code
......................................................................
Simplify GlobalBlocking code
Depends-On: I23d29c1a0e016de4e82d5b51afa94ae9afd70ee4
Change-Id: I714684a95eb239a027ee9acc8edc6155e6935823
---
M includes/specials/SpecialUploadWizard.php
1 file changed, 3 insertions(+), 9 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/92/285292/1
diff --git a/includes/specials/SpecialUploadWizard.php
b/includes/specials/SpecialUploadWizard.php
index ab1e4dc..02491fb 100644
--- a/includes/specials/SpecialUploadWizard.php
+++ b/includes/specials/SpecialUploadWizard.php
@@ -315,18 +315,12 @@
// Check blocks
if ( $user->isBlocked() ) {
- throw new UserBlockedError( $this->getUser()->mBlock );
+ throw new UserBlockedError( $user->getBlock() );
}
// Global blocks
- if ( class_exists( 'GlobalBlocking' ) ) {
- $error = GlobalBlocking::getUserBlockErrors(
- $user,
- $this->getRequest()->getIP()
- );
- if ( count( $error ) ) {
- throw new ErrorPageError( 'blockedtitle',
array_shift( $error ), $error );
- }
+ if ( $user->isBlockedGlobally() ) {
+ throw new UserBlockedError( $user->getGlobalBlock() );
}
// we got all the way here, so it must be okay to upload
--
To view, visit https://gerrit.wikimedia.org/r/285292
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I714684a95eb239a027ee9acc8edc6155e6935823
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits