}
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 );
} 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' );
}
}
}
return $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'user' );
}
-
+
/**
* Gets all the groups that a user is automatically a member of
* @return array
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(