Index: trunk/phase3/includes/api/ApiQueryUsers.php |
— | — | @@ -130,20 +130,25 @@ |
131 | 131 | $user = User::newFromRow( $r ); |
132 | 132 | $name = $user->getName(); |
133 | 133 | $data[$name]['name'] = $name; |
| 134 | + |
134 | 135 | if ( isset( $this->prop['editcount'] ) ) { |
135 | 136 | $data[$name]['editcount'] = intval( $user->getEditCount() ); |
136 | 137 | } |
| 138 | + |
137 | 139 | if ( isset( $this->prop['registration'] ) ) { |
138 | 140 | $data[$name]['registration'] = wfTimestampOrNull( TS_ISO_8601, $user->getRegistration() ); |
139 | 141 | } |
| 142 | + |
140 | 143 | if ( isset( $this->prop['groups'] ) && !is_null( $r->ug_group ) ) { |
141 | 144 | // This row contains only one group, others will be added from other rows |
142 | 145 | $data[$name]['groups'][] = $r->ug_group; |
143 | 146 | } |
| 147 | + |
144 | 148 | if ( isset( $this->prop['blockinfo'] ) && !is_null( $r->blocker_name ) ) { |
145 | 149 | $data[$name]['blockedby'] = $r->blocker_name; |
146 | 150 | $data[$name]['blockreason'] = $r->ipb_reason; |
147 | 151 | } |
| 152 | + |
148 | 153 | if ( isset( $this->prop['emailable'] ) && $user->canReceiveEmail() ) { |
149 | 154 | $data[$name]['emailable'] = ''; |
150 | 155 | } |
— | — | @@ -175,10 +180,13 @@ |
176 | 181 | $data[$u] = array( 'name' => $u ); |
177 | 182 | $urPage = new UserrightsPage; |
178 | 183 | $iwUser = $urPage->fetchUser( $u ); |
| 184 | + |
179 | 185 | if ( $iwUser instanceof UserRightsProxy ) { |
180 | 186 | $data[$u]['interwiki'] = ''; |
| 187 | + |
181 | 188 | if ( !is_null( $params['token'] ) ) { |
182 | 189 | $tokenFunctions = $this->getTokenFunctions(); |
| 190 | + |
183 | 191 | foreach ( $params['token'] as $t ) { |
184 | 192 | $val = call_user_func( $tokenFunctions[$t], $iwUser ); |
185 | 193 | if ( $val === false ) { |
— | — | @@ -192,8 +200,15 @@ |
193 | 201 | $data[$u]['missing'] = ''; |
194 | 202 | } |
195 | 203 | } else { |
196 | | - if ( isset( $this->prop['groups'] ) && isset( $data[$u]['groups'] ) ) |
197 | | - { |
| 204 | + if ( isset( $this->prop['groups'] ) && isset( $data[$u]['groups'] ) ) { |
| 205 | + $autolist = array(); |
| 206 | + $autolist[] = "*"; |
| 207 | + foreach( Autopromote::getAutopromoteGroups( User::newFromName( $u ) ) as $group ) { |
| 208 | + $autolist[] = $group; |
| 209 | + } |
| 210 | + |
| 211 | + $data[$u]['groups'] = array_merge( $autolist, $data[$u]['groups'] ); |
| 212 | + |
198 | 213 | $this->getResult()->setIndexedTagName( $data[$u]['groups'], 'g' ); |
199 | 214 | } |
200 | 215 | } |
Index: trunk/phase3/includes/specials/SpecialUserrights.php |
— | — | @@ -32,10 +32,10 @@ |
33 | 33 | public function userCanChangeRights( $user, $checkIfSelf = true ) { |
34 | 34 | $available = $this->changeableGroups(); |
35 | 35 | return !empty( $available['add'] ) |
36 | | - or !empty( $available['remove'] ) |
37 | | - or ( ( $this->isself || !$checkIfSelf ) and |
| 36 | + || !empty( $available['remove'] ) |
| 37 | + || ( ( $this->isself || !$checkIfSelf ) && |
38 | 38 | ( !empty( $available['add-self'] ) |
39 | | - or !empty( $available['remove-self'] ) ) ); |
| 39 | + || !empty( $available['remove-self'] ) ) ); |
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
— | — | @@ -77,8 +77,9 @@ |
78 | 78 | $this->mTarget = $wgUser->getName(); |
79 | 79 | } |
80 | 80 | |
81 | | - if ( User::getCanonicalName( $this->mTarget ) == $wgUser->getName() ) |
| 81 | + if ( User::getCanonicalName( $this->mTarget ) == $wgUser->getName() ) { |
82 | 82 | $this->isself = true; |
| 83 | + } |
83 | 84 | |
84 | 85 | if( !$this->userCanChangeRights( $wgUser, true ) ) { |
85 | 86 | // fixme... there may be intermediate groups we can mention. |
— | — | @@ -99,8 +100,9 @@ |
100 | 101 | $this->setHeaders(); |
101 | 102 | |
102 | 103 | // show the general form |
103 | | - if ( count( $available['add'] ) || count( $available['remove'] ) ) |
| 104 | + if ( count( $available['add'] ) || count( $available['remove'] ) ) { |
104 | 105 | $this->switchForm(); |
| 106 | + } |
105 | 107 | |
106 | 108 | if( $wgRequest->wasPosted() ) { |
107 | 109 | // save settings |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -222,6 +222,7 @@ |
223 | 223 | thumbnailing larger than original image |
224 | 224 | * (bug 23835) Need "thumbmime" result in "imageinfo" query |
225 | 225 | * (bug 23851) Repair diff for file redirect pages |
| 226 | +* (bug 24009) Include implicit groups in action=query&list=users&usprop=groups |
226 | 227 | |
227 | 228 | === Languages updated in 1.17 === |
228 | 229 | |