See Release Notes
Long Term Support Release
Differences Between: [Versions 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]
1 <?php 2 3 require('../config.php'); 4 5 // Form submitted, do not check referer (original page unknown). 6 if ($form = data_submitted()) { 7 // Only deal with real users. 8 if (!isloggedin()) { 9 redirect($CFG->wwwroot); 10 } 11 12 // Send the message and redirect. 13 $eventdata = new \core\message\message(); 14 $eventdata->courseid = SITEID; 15 $eventdata->component = 'moodle'; 16 $eventdata->name = 'errors'; 17 $eventdata->userfrom = $USER; 18 $eventdata->userto = core_user::get_support_user(); 19 $eventdata->subject = 'Error: '. $form->referer .' -> '. $form->requested; 20 $eventdata->fullmessage = $form->text; 21 $eventdata->fullmessageformat = FORMAT_PLAIN; 22 $eventdata->fullmessagehtml = ''; 23 $eventdata->smallmessage = ''; 24 message_send($eventdata); 25 26 redirect($CFG->wwwroot .'/course/', 'Message sent, thanks', 3); 27 exit; 28 } 29 30 $site = get_site(); 31 $redirecturl = empty($_SERVER['REDIRECT_URL']) ? '' : $_SERVER['REDIRECT_URL']; 32 $httpreferer = get_local_referer(false); 33 $requesturi = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI']; 34 35 header("HTTP/1.0 404 Not Found"); 36 header("Status: 404 Not Found"); 37 38 $PAGE->set_url('/error/'); 39 $PAGE->set_context(context_system::instance()); 40 $PAGE->set_title($site->fullname .':Error'); 41 $PAGE->set_heading($site->fullname .': Error 404'); 42 $PAGE->navbar->add('Error 404 - File not Found'); 43 echo $OUTPUT->header(); 44 echo $OUTPUT->box(get_string('pagenotexist', 'error'). '<br />'.s($requesturi), 'generalbox boxaligncenter'); 45 46 if (isloggedin()) { 47 ?> 48 <p><?php echo get_string('pleasereport', 'error'); ?> 49 <p><form action="<?php echo $CFG->wwwroot ?>/error/index.php" method="post"> 50 <textarea rows="3" cols="50" name="text" id="text" spellcheck="true"></textarea><br /> 51 <input type="hidden" name="referer" value="<?php p($httpreferer) ?>"> 52 <input type="hidden" name="requested" value="<?php p($requesturi) ?>"> 53 <input type="submit" value="<?php echo get_string('sendmessage', 'error'); ?>"> 54 </form> 55 <?php 56 } else { 57 echo $OUTPUT->continue_button($CFG->wwwroot); 58 } 59 echo $OUTPUT->footer(); 60 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body