$prop = array_flip($prop);
$fld_editcount = isset($prop['editcount']);
$fld_groups = isset($prop['groups']);
+ $fld_registration = isset($prop['registration']);
} else {
- $fld_editcount = $fld_groups = false;
+ $fld_editcount = $fld_groups = $fld_registration = false;
}
$limit = $params['limit'];
$tables = $db->tableName('user');
- if (!is_null($params['from']))
- $this->addWhere('user_name>=' . $db->addQuotes(ApiQueryBase :: titleToKey($params['from'])));
-
- if (isset($params['prefix']))
- $this->addWhere("user_name LIKE '" . $db->escapeLike(ApiQueryBase :: titleToKey($params['prefix'])) . "%'");
+ if( !is_null( $params['from'] ) )
+ $this->addWhere( 'user_name >= ' . $db->addQuotes( self::keyToTitle( $params['from'] ) ) );
+
+ if( isset( $params['prefix'] ) )
+ $this->addWhere( 'user_name LIKE "' . $db->escapeLike( self::keyToTitle( $params['prefix'] ) ) . '%"' );
if (!is_null($params['group'])) {
// Filter only users that belong to a given group
} else {
$sqlLimit = $limit+1;
}
+
+ if ($fld_registration)
+ $this->addFields('user_registration');
$this->addOption('LIMIT', $sqlLimit);
$this->addTables($tables);
$lastUserData = array( 'name' => $lastUser );
if ($fld_editcount)
$lastUserData['editcount'] = intval($row->user_editcount);
+ if ($fld_registration)
+ $lastUserData['registration'] = wfTimestamp(TS_ISO_8601, $row->user_registration);
}
ApiBase :: PARAM_TYPE => array (
'editcount',
'groups',
+ 'registration',
)
),
'limit' => array (