Saltar al contenido principal

Function: userById()

function userById(
context,
siteUrl,
userId
): Promise<User | undefined>;

Defined in: areas/site/users.ts:35

A user by id, or undefined when there's nobody: no such user, one the person may not see, or a deleted account. Moodle keeps a deleted account's record and its user service still gives it to an administrator, renamed, with the email replaced by an MD5 hash of the old username (delete_user, confirmed empirically on the sandbox, 5.2); the driver treats it as gone.

Parameters​

ParameterType
contextBrowserContext
siteUrlstring
userIdnumber

Returns​

Promise<User | undefined>