Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
General web service library. More...
Public Member Functions | |
add_external_function_to_service ($functionname, $serviceid) | |
Add a function to a service. More... | |
add_external_service ($service) | |
Add a service It generates the timecreated field automatically. More... | |
add_ws_authorised_user ($user) | |
Allow user to call a service. More... | |
authenticate_user ($token) | |
Authenticate user (used by download/upload file scripts) More... | |
delete_service ($serviceid) | |
Delete a service Also delete function references and authorised user references. More... | |
delete_user_ws_token ($tokenid) | |
Delete a token. More... | |
generate_user_ws_tokens ($userid) | |
Generate all tokens of a specific user. More... | |
get_created_by_user_ws_token ($userid, $tokenid) | |
Return a token that has been created by the user (i.e. More... | |
get_external_function_by_id ($functionid, $strictness=IGNORE_MISSING) | |
Get an external function for a given function id. More... | |
get_external_functions ($serviceids) | |
Get the functions list of a service list (by id) More... | |
get_external_functions_by_enabled_services ($serviceshortnames, $enabledonly=true) | |
Get the functions of a service list (by shortname). More... | |
get_external_service_by_id ($serviceid, $strictness=IGNORE_MISSING) | |
Get an external service for a given service id. More... | |
get_external_service_by_shortname ($shortname, $strictness=IGNORE_MISSING) | |
Get an external service for a given shortname. More... | |
get_missing_capabilities_by_users ($users, $serviceid) | |
Get missing user capabilities for a given service WARNING: do not use this "broken" function. More... | |
get_not_associated_external_functions ($serviceid) | |
Get functions not included in a service. More... | |
get_service_required_capabilities ($serviceid) | |
Get list of required capabilities of a service, sorted by functions Example of returned value: Array ( [core_group_create_groups] => Array ( [0] => moodle/course:managegroups ) More... | |
get_token_by_id ($tokenid) | |
Return a database token record for a token id. More... | |
get_token_by_id_with_details ($tokenid) | |
Return a token of an arbitrary user by tokenid, including details of the associated user and the service name. More... | |
get_user_capabilities ($userid) | |
Get user capabilities (with context) Only useful for documentation purpose WARNING: do not use this "broken" function. More... | |
get_user_ws_token ($token) | |
Get a full database token record for a given token value. More... | |
get_user_ws_tokens ($userid) | |
Return all tokens of a specific user. More... | |
get_ws_authorised_user ($serviceid, $userid) | |
Return an authorised user with their options (ip/timecreated / validuntil...) More... | |
get_ws_authorised_users ($serviceid) | |
Return list of allowed users with their options (ip/timecreated / validuntil...) for a given service. More... | |
remove_external_function_from_service ($functionname, $serviceid) | |
Remove a function from a service. More... | |
remove_ws_authorised_user ($user, $serviceid) | |
Disallow a user to call a service. More... | |
service_function_exists ($functionname, $serviceid) | |
Test whether an external function is already linked to a service. More... | |
update_external_service ($service) | |
Update a service It modifies the timemodified automatically. More... | |
update_ws_authorised_user ($user) | |
Update allowed user settings (ip restriction, valid until...) More... | |
Static Public Member Functions | |
static | delete_user_ws_tokens ($userid) |
Delete all the tokens belonging to a user. More... | |
static | get_active_tokens ($userid) |
Return a list with all the valid user tokens for the given user, it only excludes expired tokens. More... | |
static | update_token_lastaccess ($token, int $time=0) |
Updates the last access time for a token. More... | |
Public Attributes | |
int const | TOKEN_LASTACCESS_UPDATE_SECS = 60 |
Only update token last access once per this many seconds. More... | |
General web service library.