Although not strictly a way to secure your site, logging your actions will enable you to determine what was done and who did it. Moodle provides a function, add_to_log
, which allows you to create log entries that identify what was done in your code.
The specification of the add_to_log
function is as follows:
/** * Add an entry to the log table. These are "action" focussed rather * than web server hits, and provide a way to easily reconstruct what * any particular student has been doing. * * @param int $courseid The course id * @param string $module The module name - e.g. forum, journal, resource, course, user etc * @param string $action 'view', 'update', 'add' or 'delete', possibly followed by another word to clarify. * @param string $url The file and parameters used to see the results of the action * @param string $info Additional description information * @param string $cm The course_module->id if there is one * @param string $user If log regards $user other than...