r56381 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56380‎ | r56381 | r56382 >
Date:18:16, 15 September 2009
Author:brion
Status:deferred
Tags:
Comment:
Merge r56325 from trunk
Modified paths:
  • /branches/wmf-deployment-work/RELEASE-NOTES (modified) (history)
  • /branches/wmf-deployment-work/includes/User.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment-work/includes/User.php
@@ -1066,7 +1066,7 @@
10671067 * done against master.
10681068 */
10691069 function getBlockedStatus( $bFromSlave = true ) {
1070 - global $wgEnableSorbs, $wgProxyWhitelist;
 1070+ global $wgEnableSorbs, $wgProxyWhitelist, $wgUser;
10711071
10721072 if ( -1 != $this->mBlockedby ) {
10731073 wfDebug( "User::getBlockedStatus: already loaded.\n" );
@@ -1086,9 +1086,25 @@
10871087 $this->mBlockedby = 0;
10881088 $this->mHideName = 0;
10891089 $this->mAllowUsertalk = 0;
1090 - $ip = wfGetIP();
10911090
1092 - if ($this->isAllowed( 'ipblock-exempt' ) ) {
 1091+ # Check if we are looking at an IP or a logged-in user
 1092+ if ( $this->isIP( $this->getName() ) ) {
 1093+ $ip = $this->getName();
 1094+ }
 1095+ else {
 1096+ # Check if we are looking at the current user
 1097+ # If we don't, and the user is logged in, we don't know about
 1098+ # his IP / autoblock status, so ignore autoblock of current user's IP
 1099+ if ( $this->getID() != $wgUser->getID() ) {
 1100+ $ip = '';
 1101+ }
 1102+ else {
 1103+ # Get IP of current user
 1104+ $ip = wfGetIP();
 1105+ }
 1106+ }
 1107+
 1108+ if ( $this->isAllowed( 'ipblock-exempt' ) ) {
10931109 # Exempt from all types of IP-block
10941110 $ip = '';
10951111 }
Index: branches/wmf-deployment-work/RELEASE-NOTES
@@ -470,6 +470,8 @@
471471 empty portlets are now present but hidden, adding an element to a portlet unhides it
472472 * (bug 19531) addPortletLink() now wraps inserted labels in a <span> element to be
473473 compatible with the CSS for the Vector skin
 474+* User::getBlockedStatus() works for all kinds of user objects and doesn't
 475+ assume the user object is equal to the current-user object ($wgUser)
474476
475477 == API changes in 1.16 ==
476478

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56325Fixing User::getBlockedStatus which broke r55918. Function now works for all ...churchofemacs19:34, 14 September 2009

Status & tagging log