39 parent::__construct( $query, $moduleName,
'oath' );
44 if ( $params[
'user'] ===
null ) {
45 $params[
'user'] = $this->
getUser()->getName();
51 if ( $user ===
false ) {
57 ApiResult::META_BC_BOOLS => [
'enabled' ],
61 if ( !$user->isAnon() ) {
63 $authUser = $userRepo->findByUser( $user );
64 $data[
'enabled'] = $authUser &&
65 $authUser->getModule() !==
null &&
66 $authUser->getModule()->isEnabled( $authUser );
94 'action=query&meta=oath'
95 =>
'apihelp-query+oath-example-1',
96 'action=query&meta=oath&oathuser=Example'
97 =>
'apihelp-query+oath-example-2',
This abstract class implements many basic API functions, and is the base of all API classes.
checkUserRightsAny( $rights, $user=null)
Helper function for permission-denied errors.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
getResult()
Get the result object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getModuleName()
Get the name of the module being executed by this instance.
This is a base class for all Query modules.
This class represents the result of the API operations.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.