Search moodle.org's
Developer Documentation


  • Bug fixes for general core bugs in 2.8.x ended 9 November 2015 (12 months).
  • Bug fixes for security issues in 2.8.x ended 9 May 2016 (18 months).
  • minimum PHP 5.4.4 (always use latest PHP 5.4.x or 5.5.x on Windows - http://windows.php.net/download/), PHP 7 is NOT supported
  • Differences Between: [Versions 28 and 29] [Versions 28 and 30] [Versions 28 and 31] [Versions 28 and 32] [Versions 28 and 33] [Versions 28 and 34] [Versions 28 and 35] [Versions 28 and 36] [Versions 28 and 37]

    External user API

    Copyright: 2009 Petr Skodak
    License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
    File Size: 1415 lines (62 kb)
    Included or required:0 times
    Referenced: 15 times
    Includes or requires: 0 files

    Defines 2 classes


    Class: core_user_external  - X-Ref

    User external functions

    create_users_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    create_users($users)   X-Ref
    Create one or more users.

    return: array An array of arrays
    param: array $users An array of users to create.

    create_users_returns()   X-Ref
    Returns description of method result value

    return: external_description

    delete_users_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    delete_users($userids)   X-Ref
    Delete users

    return: null
    param: array $userids

    delete_users_returns()   X-Ref
    Returns description of method result value

    return: null

    update_users_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    update_users($users)   X-Ref
    Update users

    return: null
    param: array $users

    update_users_returns()   X-Ref
    Returns description of method result value

    return: null

    get_users_by_field_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    get_users_by_field($field, $values)   X-Ref
    Get user information for a unique field.

    return: array An array of arrays containg user profiles.
    param: string $field
    param: array $values

    get_users_by_field_returns()   X-Ref
    Returns description of method result value

    return: external_multiple_structure

    get_users_parameters()   X-Ref
    Returns description of get_users() parameters.

    return: external_function_parameters

    get_users($criteria = array()   X-Ref
    Retrieve matching user.

    return: array An array of arrays containing user profiles.
    param: array $criteria the allowed array keys are id/lastname/firstname/idnumber/username/email/auth.

    get_users_returns()   X-Ref
    Returns description of get_users result value.

    return: external_description

    get_users_by_id_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    get_users_by_id($userids)   X-Ref
    Get user information
    - This function is matching the permissions of /user/profil.php
    - It is also matching some permissions from /user/editadvanced.php for the following fields:
    auth, confirmed, idnumber, lang, theme, timezone, mailformat

    return: array An array of arrays describing users
    param: array $userids  array of user ids

    get_users_by_id_returns()   X-Ref
    Returns description of method result value

    return: external_description

    get_course_user_profiles_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    get_course_user_profiles($userlist)   X-Ref
    Get course participant's details

    return: array An array of arrays describing course participants
    param: array $userlist  array of user ids and according course ids

    get_course_user_profiles_returns()   X-Ref
    Returns description of method result value

    return: external_description

    user_description($additionalfields = array()   X-Ref
    Create user return value description.

    return: single_structure_description
    param: array $additionalfields some additional field

    add_user_private_files_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    add_user_private_files($draftid)   X-Ref
    Copy files from a draft area to users private files area.

    return: array An array of warnings
    param: int $draftid Id of a draft area containing files.

    add_user_private_files_returns()   X-Ref
    Returns description of method result value

    return: external_description

    add_user_device_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters

    add_user_device($appid, $name, $model, $platform, $version, $pushid, $uuid)   X-Ref
    Add a user device in Moodle database (for PUSH notifications usually).

    return: array List of possible warnings.
    param: string $appid The app id, usually something like com.moodle.moodlemobile.
    param: string $name The device name, occam or iPhone etc.
    param: string $model The device model Nexus4 or iPad1.1 etc.
    param: string $platform The device platform iOs or Android etc.
    param: string $version The device version 6.1.2 or 4.2.2 etc.
    param: string $pushid The device PUSH token/key/identifier/registration id.
    param: string $uuid The device UUID.

    add_user_device_returns()   X-Ref
    Returns description of method result value.

    return: external_multiple_structure

    Class: moodle_user_external  - X-Ref

    Deprecated user external functions

    create_users_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    create_users($users)   X-Ref
    Create one or more users

    return: array An array of arrays
    param: array $users  An array of users to create.

    create_users_returns()   X-Ref
    Returns description of method result value

    return: external_description

    delete_users_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    delete_users($userids)   X-Ref
    Delete users

    return: null
    param: array $userids

    delete_users_returns()   X-Ref
    Returns description of method result value

    return: null

    update_users_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    update_users($users)   X-Ref
    Update users

    return: null
    param: array $users

    update_users_returns()   X-Ref
    Returns description of method result value

    return: null

    get_users_by_id_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    get_users_by_id($userids)   X-Ref
    Get user information
    - This function is matching the permissions of /user/profil.php
    - It is also matching some permissions from /user/editadvanced.php for the following fields:
    auth, confirmed, idnumber, lang, theme, timezone, mailformat

    return: array An array of arrays describing users
    param: array $userids  array of user ids

    get_users_by_id_returns()   X-Ref
    Returns description of method result value

    return: external_description

    get_course_participants_by_id_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    get_course_participants_by_id($userlist)   X-Ref
    Get course participant's details

    return: array An array of arrays describing course participants
    param: array $userlist  array of user ids and according course ids

    get_course_participants_by_id_returns()   X-Ref
    Returns description of method result value

    return: external_description

    get_users_by_courseid_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    get_users_by_courseid($courseid, $options)   X-Ref
    Get course participants details

    return: array An array of users
    param: int $courseid  course id
    param: array $options options {

    get_users_by_courseid_returns()   X-Ref
    Returns description of method result value

    return: external_description

    Search This Site: