-(bug 24484) Add prop=pageprops module
[lhc/web/wiklou.git] / includes / api / ApiQueryUsers.php
index b50fe71..4fd256f 100644 (file)
@@ -160,9 +160,6 @@ if ( !defined( 'MEDIAWIKI' ) ) {
                                }
 
                                if ( !is_null( $params['token'] ) ) {
-                                       // Don't cache tokens
-                                       $this->getMain()->setCachePrivate();
-                                       
                                        $tokenFunctions = $this->getTokenFunctions();
                                        foreach ( $params['token'] as $t ) {
                                                $val = call_user_func( $tokenFunctions[$t], $user );
@@ -203,9 +200,9 @@ if ( !defined( 'MEDIAWIKI' ) ) {
                        } else {
                                if ( isset( $this->prop['groups'] ) && isset( $data[$u]['groups'] ) ) {
                                        $autolist = ApiQueryUsers::getAutoGroups( User::newFromName( $u ) );
-                                       
+
                                        $data[$u]['groups'] = array_merge( $autolist, $data[$u]['groups'] );
-                               
+
                                        $this->getResult()->setIndexedTagName( $data[$u]['groups'], 'g' );
                                }
                        }
@@ -220,7 +217,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
                }
                return $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'user' );
        }
-       
+
        /**
        * Gets all the groups that a user is automatically a member of
        * @return array
@@ -235,6 +232,14 @@ if ( !defined( 'MEDIAWIKI' ) ) {
                return array_merge( $groups, Autopromote::getAutopromoteGroups( $user ) );
        }
 
+       public function getCacheMode( $params ) {
+               if ( isset( $params['token'] ) ) {
+                       return 'private';
+               } else {
+                       return 'public';
+               }
+       }
+
        public function getAllowedParams() {
                return array(
                        'prop' => array(