2009-10-15 03:22:26 +00:00
|
|
|
<?php
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2004-09-24 22:28:50 +00:00
|
|
|
require('../config.php');
|
2008-07-24 08:38:03 +00:00
|
|
|
require_once($CFG->libdir.'/eventslib.php');
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2013-09-12 11:12:37 +08:00
|
|
|
// Form submitted, do not check referer (original page unknown).
|
|
|
|
if ($form = data_submitted()) {
|
|
|
|
// Only deal with real users.
|
2009-11-01 16:48:45 +00:00
|
|
|
if (!isloggedin()) {
|
2008-02-01 05:49:15 +00:00
|
|
|
redirect($CFG->wwwroot);
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
|
2013-08-30 14:28:17 +08:00
|
|
|
// Send the message and redirect.
|
2016-10-31 14:13:13 -04:00
|
|
|
$eventdata = new \core\message\message();
|
|
|
|
$eventdata->courseid = SITEID;
|
2013-08-30 14:28:17 +08:00
|
|
|
$eventdata->component = 'moodle';
|
|
|
|
$eventdata->name = 'errors';
|
2008-07-24 08:38:03 +00:00
|
|
|
$eventdata->userfrom = $USER;
|
2013-08-30 14:28:17 +08:00
|
|
|
$eventdata->userto = core_user::get_support_user();
|
2008-07-24 08:38:03 +00:00
|
|
|
$eventdata->subject = 'Error: '. $form->referer .' -> '. $form->requested;
|
|
|
|
$eventdata->fullmessage = $form->text;
|
|
|
|
$eventdata->fullmessageformat = FORMAT_PLAIN;
|
|
|
|
$eventdata->fullmessagehtml = '';
|
2008-08-02 00:04:29 +00:00
|
|
|
$eventdata->smallmessage = '';
|
2009-11-07 10:27:57 +00:00
|
|
|
message_send($eventdata);
|
2009-11-01 16:48:45 +00:00
|
|
|
|
2004-09-24 22:28:50 +00:00
|
|
|
redirect($CFG->wwwroot .'/course/', 'Message sent, thanks', 3);
|
2008-02-01 05:49:15 +00:00
|
|
|
exit;
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
2002-09-17 14:56:18 +00:00
|
|
|
|
|
|
|
$site = get_site();
|
2005-10-31 22:49:13 +00:00
|
|
|
$redirecturl = empty($_SERVER['REDIRECT_URL']) ? '' : $_SERVER['REDIRECT_URL'];
|
2015-06-12 14:27:55 +08:00
|
|
|
$httpreferer = get_local_referer(false);
|
2005-10-31 22:49:13 +00:00
|
|
|
$requesturi = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI'];
|
2009-11-01 16:48:45 +00:00
|
|
|
|
2008-02-01 05:49:15 +00:00
|
|
|
header("HTTP/1.0 404 Not Found");
|
|
|
|
header("Status: 404 Not Found");
|
|
|
|
|
2010-01-16 15:39:56 +00:00
|
|
|
$PAGE->set_url('/error/');
|
2013-08-26 15:20:57 +08:00
|
|
|
$PAGE->set_context(context_system::instance());
|
2009-09-07 07:20:14 +00:00
|
|
|
$PAGE->set_title($site->fullname .':Error');
|
|
|
|
$PAGE->set_heading($site->fullname .': Error 404');
|
|
|
|
$PAGE->navbar->add('Error 404 - File not Found');
|
|
|
|
echo $OUTPUT->header();
|
2009-08-18 05:20:12 +00:00
|
|
|
echo $OUTPUT->box(get_string('pagenotexist', 'error'). '<br />'.s($requesturi), 'generalbox boxaligncenter');
|
2008-02-01 05:49:15 +00:00
|
|
|
|
|
|
|
if (isloggedin()) {
|
2001-11-22 06:23:56 +00:00
|
|
|
?>
|
2008-02-01 05:49:15 +00:00
|
|
|
<p><?php echo get_string('pleasereport', 'error'); ?>
|
|
|
|
<p><form action="<?php echo $CFG->wwwroot ?>/error/index.php" method="post">
|
2013-04-07 18:18:01 +02:00
|
|
|
<textarea rows="3" cols="50" name="text" id="text" spellcheck="true"></textarea><br />
|
2008-02-01 05:49:15 +00:00
|
|
|
<input type="hidden" name="referer" value="<?php p($httpreferer) ?>">
|
|
|
|
<input type="hidden" name="requested" value="<?php p($requesturi) ?>">
|
|
|
|
<input type="submit" value="<?php echo get_string('sendmessage', 'error'); ?>">
|
|
|
|
</form>
|
2003-09-11 13:50:02 +00:00
|
|
|
<?php
|
2008-02-01 05:49:15 +00:00
|
|
|
} else {
|
2009-08-18 05:20:12 +00:00
|
|
|
echo $OUTPUT->continue_button($CFG->wwwroot);
|
2008-02-01 05:49:15 +00:00
|
|
|
}
|
2009-08-06 14:21:34 +00:00
|
|
|
echo $OUTPUT->footer();
|
2005-11-01 06:53:57 +00:00
|
|
|
?>
|