See Release Notes
Long Term Support Release
Differences Between: [Versions 401 and 403]
Guest access plugin. This plugin does not add any entries into the user_enrolments table, the access control is granted on the fly via the tricks in require_login().
Copyright: | 2010 Petr Skoda {@link http://skodak.org} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 492 lines (17 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
enrol_guest_plugin:: (19 methods):
get_info_icons()
enrol_user()
unenrol_user()
try_guestaccess()
can_add_instance()
enrol_page_hook()
course_updated()
add_instance()
add_default_instance()
restore_instance()
can_delete_instance()
can_hide_show_instance()
get_instance_defaults()
get_enrol_info()
get_status_options()
edit_instance_form()
use_standard_editing_ui()
edit_instance_validation()
enrol_guest_get_fontawesome_icon_map()
Class: enrol_guest_plugin - X-Ref
Class enrol_guest_pluginget_info_icons(array $instances) X-Ref |
Returns optional enrolment information icons. This is used in course list for quick overview of enrolment options. We are not using single instance parameter because sometimes we might want to prevent icon repetition when multiple instances of one type exist. One instance may also produce several icons. param: array $instances all enrol instances of this type in one course return: array of pix_icon |
enrol_user(stdClass $instance, $userid, $roleid = null, $timestart = 0, $timeend = 0, $status = null, $recovergrades = null) X-Ref |
Enrol a user using a given enrolment instance. param: stdClass $instance param: int $userid param: null $roleid param: int $timestart param: int $timeend param: null $status param: null $recovergrades |
unenrol_user(stdClass $instance, $userid) X-Ref |
Enrol a user from a given enrolment instance. param: stdClass $instance param: int $userid |
try_guestaccess(stdClass $instance) X-Ref |
Attempt to automatically gain temporary guest access to course, calling code has to make sure the plugin and instance are active. param: stdClass $instance course enrol instance return: bool|int false means no guest access, integer means end of cached time |
can_add_instance($courseid) X-Ref |
Returns true if the current user can add a new instance of enrolment plugin in course. param: int $courseid return: boolean |
enrol_page_hook(stdClass $instance) X-Ref |
Creates course enrol form, checks if form submitted and enrols user if necessary. It can also redirect. param: stdClass $instance return: string html text, usually a form in a text box |
course_updated($inserted, $course, $data) X-Ref |
Called after updating/inserting course. param: bool $inserted true if course just inserted param: object $course param: object $data form data return: void |
add_instance($course, array $fields = NULL) X-Ref |
Add new instance of enrol plugin. param: object $course param: array instance fields return: int id of new instance, null if can not be created |
add_default_instance($course) X-Ref |
Add new instance of enrol plugin with default settings. param: object $course return: int id of new instance |
restore_instance(restore_enrolments_structure_step $step, stdClass $data, $course, $oldid) X-Ref |
Restore instance and map settings. param: restore_enrolments_structure_step $step param: stdClass $data param: stdClass $course param: int $oldid |
can_delete_instance($instance) X-Ref |
Is it possible to delete enrol instance via standard UI? param: object $instance return: bool |
can_hide_show_instance($instance) X-Ref |
Is it possible to hide/show enrol instance via standard UI? param: stdClass $instance return: bool |
get_instance_defaults() X-Ref |
Get default settings for enrol_guest. return: array |
get_enrol_info(stdClass $instance) X-Ref |
Return information for enrolment instance containing list of parameters required for enrolment, name of enrolment plugin etc. param: stdClass $instance enrolment instance return: stdClass instance info. |
get_status_options() X-Ref |
Return an array of valid options for the status. return: array |
edit_instance_form($instance, MoodleQuickForm $mform, $context) X-Ref |
Add elements to the edit instance form. param: stdClass $instance param: MoodleQuickForm $mform param: context $context return: bool |
use_standard_editing_ui() X-Ref |
We are a good plugin and don't invent our own UI/validation code path. return: boolean |
edit_instance_validation($data, $files, $instance, $context) X-Ref |
Perform custom validation of the data used to edit the instance. param: array $data array of ("fieldname"=>value) of submitted data param: array $files array of uploaded files "element_name"=>tmp_file_path param: object $instance The instance loaded from the DB param: context $context The context of the instance we are editing return: array of "element_name"=>"error_description" if there are errors, return: void |
enrol_guest_get_fontawesome_icon_map() X-Ref |
Get icon mapping for font-awesome. |