Index: trunk/phase3/includes/api/ApiQueryAllUsers.php |
— | — | @@ -216,23 +216,26 @@ |
217 | 217 | } |
218 | 218 | |
219 | 219 | // Add user's group info |
220 | | - if ( $fld_groups && !is_null( $row->ug_group2 ) ) { |
| 220 | + if ( $fld_groups ) { |
221 | 221 | if ( !isset( $lastUserData['groups'] ) ) { |
222 | 222 | $lastUserData['groups'] = ApiQueryUsers::getAutoGroups( User::newFromName( $lastUser ) ); |
223 | 223 | } |
224 | 224 | |
225 | | - $lastUserData['groups'][] = $row->ug_group2; |
| 225 | + if ( !is_null( $row->ug_group2 ) ) { |
| 226 | + $lastUserData['groups'][] = $row->ug_group2; |
| 227 | + } |
226 | 228 | $result->setIndexedTagName( $lastUserData['groups'], 'g' ); |
227 | 229 | } |
228 | 230 | |
229 | | - if ( $fld_groups ) { |
230 | | - if ( !isset( $lastUserData['groups'] ) ) { |
231 | | - $lastUserData['groups'] = ApiQueryUsers::getAutoGroups( User::newFromName( $lastUser ) ); |
| 231 | + if ( $fld_rights ) { |
| 232 | + if ( !isset( $lastUserData['rights'] ) ) { |
| 233 | + $lastUserData['rights'] = User::getGroupPermissions( User::getImplicitGroups() ); |
232 | 234 | } |
233 | 235 | if ( !is_null( $row->ug_group2 ) ) { |
234 | | - $lastUserData['groups'][] = $row->ug_group2; |
| 236 | + $lastUserData['rights'] = array_unique( array_merge( $lastUserData['rights'], |
| 237 | + User::getGroupPermissions( array( $row->ug_group2 ) ) ) ); |
235 | 238 | } |
236 | | - $result->setIndexedTagName( $lastUserData['groups'], 'g' ); |
| 239 | + $result->setIndexedTagName( $lastUserData['rights'], 'r' ); |
237 | 240 | } |
238 | 241 | } |
239 | 242 | |