Index: trunk/extensions/CentralAuth/CentralAuthUser.php |
— | — | @@ -333,6 +333,15 @@ |
334 | 334 | $workingSet = $migrationSet; |
335 | 335 | } |
336 | 336 | |
| 337 | + // Blocked accounts not allowed to get automatic home wiki |
| 338 | + foreach( $workingSet as $db => $local ) { |
| 339 | + if( $local['blocked'] ) { |
| 340 | + wfDebugLog( 'CentralAuth', |
| 341 | + "Striking blocked account $this->mName@$db from working set\n" ); |
| 342 | + unset( $workingSet[$db] ); |
| 343 | + } |
| 344 | + } |
| 345 | + |
337 | 346 | $maxEdits = -1; |
338 | 347 | $homeWiki = null; |
339 | 348 | foreach( $workingSet as $db => $local ) { |
— | — | @@ -975,7 +984,8 @@ |
976 | 985 | 'emailAuthenticated' => $row->user_email_authenticated, |
977 | 986 | 'password' => $row->user_password, |
978 | 987 | 'editCount' => $row->user_editcount, |
979 | | - 'groups' => array() ); |
| 988 | + 'groups' => array(), |
| 989 | + 'blocked' => array() ); |
980 | 990 | |
981 | 991 | // Edit count field may not be initialized... |
982 | 992 | if( is_null( $row->user_editcount ) ) { |
— | — | @@ -997,6 +1007,19 @@ |
998 | 1008 | } |
999 | 1009 | $result->free(); |
1000 | 1010 | |
| 1011 | + // And while we're in here, look for user blocks :D |
| 1012 | + $blocks = array(); |
| 1013 | + $result = $db->select( "`$dbname`.ipblocks", |
| 1014 | + array( 'ipb_expiry' ), |
| 1015 | + array( 'ipb_user' => $data['id'] ), |
| 1016 | + __METHOD__ ); |
| 1017 | + foreach( $result as $row ) { |
| 1018 | + if( Block::decodeExpiry( $row->ipb_expiry ) > wfTimestampNow() ) { |
| 1019 | + $data['blocked'] = true; |
| 1020 | + } |
| 1021 | + } |
| 1022 | + $result->free(); |
| 1023 | + |
1001 | 1024 | return $data; |
1002 | 1025 | } |
1003 | 1026 | |