Always set group_concat_max_len to avoid awful truncation gotcha
[lhc/web/wiklou.git] / includes / api / ApiQueryUserInfo.php
index 8b7831c..fed5a33 100644 (file)
@@ -69,6 +69,10 @@ class ApiQueryUserInfo extends ApiQueryBase {
                                $vals['blockedby'] = $block->getByName();
                                $vals['blockedbyid'] = $block->getBy();
                                $vals['blockreason'] = $user->blockedFor();
+                               $vals['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $block->mTimestamp );
+                               $vals['blockexpiry'] = $block->getExpiry() === 'infinity'
+                                       ? 'infinite'
+                                       : wfTimestamp( TS_ISO_8601, $block->getExpiry() );
                        }
                }
 
@@ -242,45 +246,22 @@ class ApiQueryUserInfo extends ApiQueryBase {
                                        'acceptlang',
                                        'registrationdate',
                                        'unreadcount',
-                               )
-                       )
-               );
-       }
-
-       public function getParamDescription() {
-               return array(
-                       'prop' => array(
-                               'What pieces of information to include',
-                               '  blockinfo        - Tags if the current user is blocked, by whom, and for what reason',
-                               '  hasmsg           - Adds a tag "message" if the current user has pending messages',
-                               '  groups           - Lists all the groups the current user belongs to',
-                               '  implicitgroups   - Lists all the groups the current user is automatically a member of',
-                               '  rights           - Lists all the rights the current user has',
-                               '  changeablegroups - Lists the groups the current user can add to and remove from',
-                               '  options          - Lists all preferences the current user has set',
-                               '  preferencestoken - DEPRECATED! Get a token to change current user\'s preferences',
-                               '  editcount        - Adds the current user\'s edit count',
-                               '  ratelimits       - Lists all rate limits applying to the current user',
-                               '  realname         - Adds the user\'s real name',
-                               '  email            - Adds the user\'s email address and email authentication date',
-                               '  acceptlang       - Echoes the Accept-Language header sent by ' .
-                                       'the client in a structured format',
-                               '  registrationdate - Adds the user\'s registration date',
-                               '  unreadcount      - Adds the count of unread pages on the user\'s watchlist ' .
-                                       '(maximum ' . ( self::WL_UNREAD_LIMIT - 1 ) . '; returns "' .
-                                       self::WL_UNREAD_LIMIT . '+" if more)',
+                               ),
+                               ApiBase::PARAM_HELP_MSG => array(
+                                       'apihelp-query+userinfo-param-prop',
+                                       self::WL_UNREAD_LIMIT - 1,
+                                       self::WL_UNREAD_LIMIT . '+',
+                               ),
                        )
                );
        }
 
-       public function getDescription() {
-               return 'Get information about the current user.';
-       }
-
-       public function getExamples() {
+       protected function getExamplesMessages() {
                return array(
-                       'api.php?action=query&meta=userinfo',
-                       'api.php?action=query&meta=userinfo&uiprop=blockinfo|groups|rights|hasmsg',
+                       'action=query&meta=userinfo'
+                               => 'apihelp-query+userinfo-example-simple',
+                       'action=query&meta=userinfo&uiprop=blockinfo|groups|rights|hasmsg'
+                               => 'apihelp-query+userinfo-example-data',
                );
        }