Added fix from SC22 to check arguments better.
[moodle.git] / error / index.php
blob3728e31653c9b6d6d03f7485aded1b5669b6308c
1 <?PHP // $Id$
3 require("../config.php");
5 if (isset($text)) { // form submitted
6 if (!$admin = get_admin() ) {
7 error("Could not find the admin user to mail to!");
10 email_to_user($admin, $USER, "Error: $referer -> $requested", "$text");
12 redirect("$CFG->wwwroot/course/", "Message sent, thanks", 3);
13 die;
16 $site = get_site();
18 print_header("$site->fullname:Error", "$site->fullname: Error 404", "", "form.text");
20 print_simple_box("An unusual error occurred (tried to reach a page that doesn't exist).<P align=center>$REDIRECT_URL", "center", "", "$THEME->cellheading");
24 <CENTER>
25 <P>If you have time, please let us know what you were trying
26 to do when the error occurred:
27 <P><FORM action="<?php echo $CFG->wwwroot ?>/error/index.php" name=form method=post>
28 <TEXTAREA ROWS=3 COLS=50 NAME=text></TEXTAREA><BR>
29 <INPUT TYPE=hidden NAME=referer VALUE="<?php echo $HTTP_REFERER ?>">
30 <INPUT TYPE=hidden NAME=requested VALUE="<?php echo $REQUEST_URI ?>">
31 <INPUT TYPE=submit VALUE="Send this off">
32 </FORM>
33 <?php
35 print_footer();