2001-11-22 06:23:56 +00:00
|
|
|
<?PHP // $Id$
|
|
|
|
|
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
|
|
|
|
2008-06-09 16:53:30 +00:00
|
|
|
if ($form = data_submitted()) { // form submitted, do not check referer (original page unknown)!
|
2008-02-01 05:49:15 +00:00
|
|
|
|
|
|
|
/// Only deal with real users
|
|
|
|
if (!isloggedin()) {
|
|
|
|
redirect($CFG->wwwroot);
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
|
2008-02-01 05:49:15 +00:00
|
|
|
/// Work out who to send the message to
|
|
|
|
if (!$admin = get_admin() ) {
|
2008-05-07 06:19:59 +00:00
|
|
|
print_error('cannotfindadmin', 'debug');
|
2006-05-15 15:45:27 +00:00
|
|
|
}
|
2008-02-01 05:49:15 +00:00
|
|
|
|
|
|
|
$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;
|
|
|
|
|
2008-07-24 08:38:03 +00:00
|
|
|
/// 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 = '';
|
2008-08-02 00:04:29 +00:00
|
|
|
$eventdata->smallmessage = '';
|
2008-07-24 08:38:03 +00:00
|
|
|
events_trigger('message_send', $eventdata);
|
2008-08-02 00:04:29 +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'];
|
|
|
|
$httpreferer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
|
|
|
|
$requesturi = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI'];
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2008-02-01 05:49:15 +00:00
|
|
|
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', '');
|
|
|
|
|
2006-04-21 04:42:26 +00:00
|
|
|
print_simple_box('<p align="center">'. get_string('pagenotexist', 'error'). '<br />'.s($requesturi).'</p>', 'center');
|
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
|
|
|
<center>
|
|
|
|
<p><?php echo get_string('pleasereport', 'error'); ?>
|
|
|
|
<p><form action="<?php echo $CFG->wwwroot ?>/error/index.php" method="post">
|
|
|
|
<textarea rows="3" cols="50" name="text" id="text"></textarea><br />
|
|
|
|
<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 {
|
|
|
|
print_continue($CFG->wwwroot);
|
|
|
|
}
|
|
|
|
print_footer();
|
2005-11-01 06:53:57 +00:00
|
|
|
?>
|