require_login($courseorid=NULL, $autologinguest=true, $cm=NULL, $setwantsurltome=true, $preventredirect=false)
$base_url = new moodle_url('/mod/apply/'.$action_file); $base_url->params(array('id'=>$id, 'courseid'=>$courseid));
if (data_submitted()) { if (!confirm_sesskey()) { print_error('sesskey_error', 'mdlds', $this->action_url); } }
$eventdata = new stdClass(); $eventdata->name = 'processed'; $eventdata->component = 'mod_apply'; $eventdata->userfrom = $fuser; // id またはオブジェクト $eventdata->userto = $user; // id またはオブジェクト $eventdata->subject = $postsubject; $eventdata->fullmessage = $posttext; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = $posthtml; $eventdata->smallmessage = ''; $eventdata->notification = 1; // message_send($eventdata);
$messageproviders = array ( /// Submitting a apply 'submission' => array ( ), 'processed' => array ( ) );
SELECT ra.*, r.name, r.shortname FROM {role_assignments} ra, {role} r, {context} c WHERE ra.userid = ? AND ra.roleid = r.id AND ra.contextid = c.id AND ra.contextid = ? ORDER BY c.contextlevel DESC, r.sortorder ASC
pre>
Array ( [0] => 160 [1] => 1537 )/pre>
MariaDB [moodle_db]> show columns from mdl_logstore_standard_log; +-------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------+--------------+------+-----+---------+----------------+ | id | bigint(10) | NO | PRI | NULL | auto_increment | | eventname | varchar(255) | NO | | | | | component | varchar(100) | NO | | | | | action | varchar(100) | NO | | | | | target | varchar(100) | NO | | | | | objecttable | varchar(50) | YES | | NULL | | | objectid | bigint(10) | YES | | NULL | | | crud | varchar(1) | NO | | | | | edulevel | tinyint(1) | NO | | NULL | | | contextid | bigint(10) | NO | | NULL | | | contextlevel | bigint(10) | NO | | NULL | | | contextinstanceid | bigint(10) | NO | | NULL | | | userid | bigint(10) | NO | MUL | NULL | | | courseid | bigint(10) | YES | MUL | NULL | | | relateduserid | bigint(10) | YES | | NULL | | | anonymous | tinyint(1) | NO | | 0 | | | other | longtext | YES | | NULL | | | timecreated | bigint(10) | NO | MUL | NULL | | | origin | varchar(10) | YES | | NULL | | | ip | varchar(45) | YES | | NULL | | | realuserid | bigint(10) | YES | | NULL | | +-------------------+--------------+------+-----+---------+----------------+ 21 rows in set (0.00 sec)