Index: trunk/phase3/includes/api/ApiQueryAllUsers.php |
— | — | @@ -112,6 +112,7 @@ |
113 | 113 | } else { |
114 | 114 | $sqlLimit = $limit + 1; |
115 | 115 | } |
| 116 | + |
116 | 117 | if ( $fld_blockinfo ) { |
117 | 118 | $this->addTables( 'ipblocks' ); |
118 | 119 | $this->addTables( 'user', 'u2' ); |
Index: trunk/phase3/includes/api/ApiQueryUsers.php |
— | — | @@ -126,6 +126,9 @@ |
127 | 127 | |
128 | 128 | $data = array(); |
129 | 129 | $res = $this->select( __METHOD__ ); |
| 130 | + |
| 131 | + $result = $this->getResult(); |
| 132 | + |
130 | 133 | foreach ( $res as $row ) { |
131 | 134 | $user = User::newFromRow( $row ); |
132 | 135 | $name = $user->getName(); |
— | — | @@ -140,14 +143,23 @@ |
141 | 144 | } |
142 | 145 | |
143 | 146 | if ( isset( $this->prop['groups'] ) && !is_null( $row->ug_group ) ) { |
| 147 | + if ( !isset( $data[$u]['groups'] ) ) { |
| 148 | + $data[$u]['groups'] = ApiQueryUsers::getAutoGroups( User::newFromName( $u ) ); |
| 149 | + } |
| 150 | + |
144 | 151 | // This row contains only one group, others will be added from other rows |
145 | 152 | $data[$name]['groups'][] = $row->ug_group; |
| 153 | + $result->setIndexedTagName( $data[$u]['groups'], 'g' ); |
146 | 154 | } |
147 | 155 | |
148 | | - if ( isset( $this->prop['rights'] ) && !isset( $data[$name]['rights'] ) ) { |
149 | | - // User::getRights() may return duplicate values, strip them |
150 | | - $data[$name]['rights'] = array_values( array_unique( $user->getRights() ) ); |
151 | | - $result->setIndexedTagName( $data[$name]['rights'], 'r' ); // even if empty |
| 156 | + if ( isset( $this->prop['rights'] ) && !is_null( $row->ug_group ) ) { |
| 157 | + if ( !isset( $data[$name]['rights'] ) ) { |
| 158 | + $data[$name]['rights'] = User::getGroupPermissions( User::getImplicitGroups() ); |
| 159 | + } |
| 160 | + |
| 161 | + $data[$name]['rights'] = array_unique( array_merge( $data[$name]['rights'], |
| 162 | + User::getGroupPermissions( array( $row->ug_group ) ) ) ); |
| 163 | + $result->setIndexedTagName( $data[$name]['rights'], 'r' ); |
152 | 164 | } |
153 | 165 | |
154 | 166 | if ( isset( $this->prop['blockinfo'] ) && !is_null( $row->blocker_name ) ) { |
— | — | @@ -206,15 +218,8 @@ |
207 | 219 | } else { |
208 | 220 | $data[$u]['missing'] = ''; |
209 | 221 | } |
210 | | - } else { |
211 | | - if ( isset( $this->prop['groups'] ) && isset( $data[$u]['groups'] ) ) { |
212 | | - $autolist = ApiQueryUsers::getAutoGroups( User::newFromName( $u ) ); |
| 222 | + } |
213 | 223 | |
214 | | - $data[$u]['groups'] = array_merge( $autolist, $data[$u]['groups'] ); |
215 | | - |
216 | | - $this->getResult()->setIndexedTagName( $data[$u]['groups'], 'g' ); |
217 | | - } |
218 | | - } |
219 | 224 | $fit = $result->addValue( array( 'query', $this->getModuleName() ), |
220 | 225 | null, $data[$u] ); |
221 | 226 | if ( !$fit ) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -68,6 +68,7 @@ |
69 | 69 | * action=parse now correctly returns an error for nonexistent pages |
70 | 70 | * (bug 25767) Add userrights properties to allusers and users query lists |
71 | 71 | * (bug 26558) list=allusers auprop=groups does not list groups a user is automatically a member of |
| 72 | +* (bug 26559) list=allusers auprop=rights does not match list=users usprop=rights |
72 | 73 | |
73 | 74 | === Languages updated in 1.18 === |
74 | 75 | |