Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 402 and 403]

(no description)

File Size: 123 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: utilities  - X-Ref

Class containing static utilities (such as various checks) required by the MoodleNet API.

is_valid_instance(issuer $issuer)   X-Ref
Check whether the specified issuer is configured as a MoodleNet instance that can be shared to.

param: issuer $issuer The OAuth 2 issuer being validated.
return: bool true if the issuer is enabled and available to share to.

can_user_share(\core\context\course $coursecontext, int $userid, string $type = 'activity')   X-Ref
Check whether a user has the capabilities required to share activities or courses to MoodleNet.

param: \core\context\course $coursecontext Course context where the activity or course would be shared from.
param: int $userid The user ID being checked.
param: string $type The type of resource being checked (either 'activity' or 'course').
return: boolean

get_support_url()   X-Ref
Get the support url.

return: string

does_user_have_capability_in_any_course(int $userid)   X-Ref
Check the user has a valid capability in any course they are enrolled in.

param: int $userid The user id to query
return: string Returns 'yes' if capability found, 'no' if not