libdir.'/eventslib.php'); if ($form = data_submitted()) { // form submitted, do not check referer (original page unknown)! /// Only deal with real users if (!isloggedin()) { redirect($CFG->wwwroot); } /// Work out who to send the message to if (!$admin = get_admin() ) { print_error('cannotfindadmin', 'debug'); } $supportuser = new object; $supportuser->email = $CFG->supportemail ? $CFG->supportemail : $admin->email; $supportuser->firstname = $CFG->supportname ? $CFG->supportname : $admin->firstname; $supportuser->lastname = $CFG->supportname ? '' : $admin->lastname; $supportuser->maildisplay = true; /// Send the message and redirect $eventdata = new object(); $eventdata->modulename = 'moodle'; $eventdata->userfrom = $USER; $eventdata->userto = $supportuser; $eventdata->subject = 'Error: '. $form->referer .' -> '. $form->requested; $eventdata->fullmessage = $form->text; $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = ''; $eventdata->smallmessage = ''; events_trigger('message_send', $eventdata); redirect($CFG->wwwroot .'/course/', 'Message sent, thanks', 3); exit; } $site = get_site(); $redirecturl = empty($_SERVER['REDIRECT_URL']) ? '' : $_SERVER['REDIRECT_URL']; $httpreferer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; $requesturi = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI']; header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); print_header($site->fullname .':Error', $site->fullname .': Error 404', 'Error 404 - File not Found', ''); print_simple_box('
'. get_string('pagenotexist', 'error'). '
'.s($requesturi).'
wwwroot); } print_footer(); ?>