Index: trunk/phase3/includes/api/ApiQueryAllUsers.php |
— | — | @@ -114,12 +114,10 @@ |
115 | 115 | |
116 | 116 | if ( $fld_blockinfo ) { |
117 | 117 | $this->addTables( 'ipblocks' ); |
118 | | - $this->addTables( 'user', 'u2' ); |
119 | | - $u2 = $this->getAliasedName( 'user', 'u2' ); |
120 | 118 | $this->addJoinConds( array( |
121 | 119 | 'ipblocks' => array( 'LEFT JOIN', 'ipb_user=u1.user_id' ), |
122 | | - $u2 => array( 'LEFT JOIN', 'ipb_by=u2.user_id' ) ) ); |
123 | | - $this->addFields( array( 'ipb_reason', 'u2.user_name AS blocker_name' ) ); |
| 120 | + ) ); |
| 121 | + $this->addFields( array( 'ipb_reason', 'ipb_by_text', 'ipb_expiry' ) ); |
124 | 122 | } |
125 | 123 | |
126 | 124 | $this->addOption( 'LIMIT', $sqlLimit ); |
— | — | @@ -181,9 +179,10 @@ |
182 | 180 | 'name' => $lastUser, |
183 | 181 | 'userid' => $row->user_id, |
184 | 182 | ); |
185 | | - if ( $fld_blockinfo && !is_null( $row->blocker_name ) ) { |
186 | | - $lastUserData['blockedby'] = $row->blocker_name; |
| 183 | + if ( $fld_blockinfo && !is_null( $row->ipb_by_text ) ) { |
| 184 | + $lastUserData['blockedby'] = $row->ipb_by_text; |
187 | 185 | $lastUserData['blockreason'] = $row->ipb_reason; |
| 186 | + $lastUserData['blockexpiry'] = $row->ipb_expiry; |
188 | 187 | } |
189 | 188 | if ( $fld_editcount ) { |
190 | 189 | $lastUserData['editcount'] = intval( $row->user_editcount ); |
Index: trunk/phase3/includes/api/ApiQueryUsers.php |
— | — | @@ -121,12 +121,10 @@ |
122 | 122 | } |
123 | 123 | if ( isset( $this->prop['blockinfo'] ) ) { |
124 | 124 | $this->addTables( 'ipblocks' ); |
125 | | - $this->addTables( 'user', 'u2' ); |
126 | | - $u2 = $this->getAliasedName( 'user', 'u2' ); |
127 | 125 | $this->addJoinConds( array( |
128 | 126 | 'ipblocks' => array( 'LEFT JOIN', 'ipb_user=u1.user_id' ), |
129 | | - $u2 => array( 'LEFT JOIN', 'ipb_by=u2.user_id' ) ) ); |
130 | | - $this->addFields( array( 'ipb_reason', 'u2.user_name AS blocker_name', 'ipb_expiry' ) ); |
| 127 | + ) ); |
| 128 | + $this->addFields( array( 'ipb_reason', 'ipb_by_text', 'ipb_expiry' ) ); |
131 | 129 | } |
132 | 130 | |
133 | 131 | $data = array(); |
— | — | @@ -168,7 +166,7 @@ |
169 | 167 | } |
170 | 168 | |
171 | 169 | if ( isset( $this->prop['blockinfo'] ) && !is_null( $row->blocker_name ) ) { |
172 | | - $data[$name]['blockedby'] = $row->blocker_name; |
| 170 | + $data[$name]['blockedby'] = $row->ipb_by_text; |
173 | 171 | $data[$name]['blockreason'] = $row->ipb_reason; |
174 | 172 | $data[$name]['blockexpiry'] = $row->ipb_expiry; |
175 | 173 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -179,6 +179,7 @@ |
180 | 180 | * (bug 27554) Update api information text to reflect change in bug 26125 |
181 | 181 | * (bug 27611) list=blocks: Use ipb_by_text instead of join with user table |
182 | 182 | * (bug 27616) Add userid of blocked user and blocker to list=blocks |
| 183 | +* (bug 27688) Simplify queries to list user block information |
183 | 184 | |
184 | 185 | === Languages updated in 1.18 === |
185 | 186 | |