Index: trunk/phase3/includes/User.php |
— | — | @@ -1066,7 +1066,7 @@ |
1067 | 1067 | * done against master. |
1068 | 1068 | */ |
1069 | 1069 | function getBlockedStatus( $bFromSlave = true ) { |
1070 | | - global $wgEnableSorbs, $wgProxyWhitelist; |
| 1070 | + global $wgEnableSorbs, $wgProxyWhitelist, $wgUser; |
1071 | 1071 | |
1072 | 1072 | if ( -1 != $this->mBlockedby ) { |
1073 | 1073 | wfDebug( "User::getBlockedStatus: already loaded.\n" ); |
— | — | @@ -1086,9 +1086,25 @@ |
1087 | 1087 | $this->mBlockedby = 0; |
1088 | 1088 | $this->mHideName = 0; |
1089 | 1089 | $this->mAllowUsertalk = 0; |
1090 | | - $ip = wfGetIP(); |
1091 | 1090 | |
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' ) ) { |
1093 | 1109 | # Exempt from all types of IP-block |
1094 | 1110 | $ip = ''; |
1095 | 1111 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -500,6 +500,8 @@ |
501 | 501 | * (bug 20634) The installer-created database user will now have all rights on |
502 | 502 | the database so that upgrades will go more smoothly. |
503 | 503 | * (bug 18180) Special:Export ignores limit, dir, offset parameters |
| 504 | +* User::getBlockedStatus() works for all kinds of user objects and doesn't |
| 505 | + assume the user object is equal to the current-user object ($wgUser) |
504 | 506 | |
505 | 507 | == API changes in 1.16 == |
506 | 508 | |