Index: trunk/phase3/includes/api/ApiQueryAllUsers.php |
— | — | @@ -59,13 +59,12 @@ |
60 | 60 | $this->addTables( 'user' ); |
61 | 61 | $useIndex = true; |
62 | 62 | |
63 | | - if ( !is_null( $params['from'] ) ) { |
64 | | - $this->addWhere( 'user_name >= ' . $db->addQuotes( $this->keyToTitle( $params['from'] ) ) ); |
65 | | - } |
66 | | - if ( !is_null( $params['to'] ) ) { |
67 | | - $this->addWhere( 'user_name <= ' . $db->addQuotes( $this->keyToTitle( $params['to'] ) ) ); |
68 | | - } |
| 63 | + $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
| 64 | + $from = is_null( $params['from'] ) ? null : $this->keyToTitle( $params['from'] ); |
| 65 | + $to = is_null( $params['to'] ) ? null : $this->keyToTitle( $params['to'] ); |
69 | 66 | |
| 67 | + $this->addWhereRange( 'user_name', $dir, $from, $to ); |
| 68 | + |
70 | 69 | if ( !is_null( $params['prefix'] ) ) { |
71 | 70 | $this->addWhere( 'user_name' . $db->buildLike( $this->keyToTitle( $params['prefix'] ), $db->anyString() ) ); |
72 | 71 | } |
— | — | @@ -123,7 +122,6 @@ |
124 | 123 | $this->addFieldsIf( 'user_editcount', $fld_editcount ); |
125 | 124 | $this->addFieldsIf( 'user_registration', $fld_registration ); |
126 | 125 | |
127 | | - $this->addOption( 'ORDER BY', 'user_name' ); |
128 | 126 | if ( $useIndex ) { |
129 | 127 | $this->addOption( 'USE INDEX', array( 'user' => 'user_name' ) ); |
130 | 128 | } |
— | — | @@ -239,6 +237,13 @@ |
240 | 238 | 'from' => null, |
241 | 239 | 'to' => null, |
242 | 240 | 'prefix' => null, |
| 241 | + 'dir' => array( |
| 242 | + ApiBase::PARAM_DFLT => 'ascending', |
| 243 | + ApiBase::PARAM_TYPE => array( |
| 244 | + 'ascending', |
| 245 | + 'descending' |
| 246 | + ), |
| 247 | + ), |
243 | 248 | 'group' => array( |
244 | 249 | ApiBase::PARAM_TYPE => User::getAllGroups(), |
245 | 250 | ApiBase::PARAM_ISMULTI => true, |
— | — | @@ -273,6 +278,7 @@ |
274 | 279 | 'from' => 'The user name to start enumerating from', |
275 | 280 | 'to' => 'The user name to stop enumerating at', |
276 | 281 | 'prefix' => 'Search for all users that begin with this value', |
| 282 | + 'dir' => 'Direction to sort in', |
277 | 283 | 'group' => 'Limit users to given group name(s)', |
278 | 284 | 'rights' => 'Limit users to given right(s)', |
279 | 285 | 'prop' => array( |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -249,6 +249,7 @@ |
250 | 250 | * (bug 27182) API: Add filter by prefix for meta=allmessages |
251 | 251 | * (bug 27183) API: Add filter by customisation state for meta=allmessages |
252 | 252 | * (bug 27340) API: Allow listing of "small" categories |
| 253 | +* (bug 27342) Add audir param to list=allusers |
253 | 254 | |
254 | 255 | === Languages updated in 1.18 === |
255 | 256 | |