Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / error / index.php
blobd8633575be1bdc5105b3b90fd9d1a55f5c85f9e2
1 <?PHP // $Id$
3 require('../config.php');
5 if ($form = data_submitted('nomatch')) { // form submitted, do not check referer (origal page unknown)!
6 if (!$admin = get_admin() ) {
7 error('Could not find the admin user to mail to!');
10 if (empty($USER->id)) {
11 $user = getremoteaddr(); // user not logged in, use IP address as name
12 } else {
13 $user = $USER;
15 email_to_user($admin, $user, 'Error: '. $form->referer .' -> '. $form->requested, $form->text);
17 redirect($CFG->wwwroot .'/course/', 'Message sent, thanks', 3);
18 die;
21 $site = get_site();
22 $redirecturl = empty($_SERVER['REDIRECT_URL']) ? '' : $_SERVER['REDIRECT_URL'];
23 $httpreferer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
24 $requesturi = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI'];
26 print_header($site->fullname .':Error', $site->fullname .': Error 404', '', 'text');
27 print_simple_box('<p align="center">'. get_string('pagenotexist', 'error'). '<br />'.s($requesturi).'</p>', 'center');
31 <center>
32 <p><?php echo get_string('pleasereport', 'error'); ?>
33 <p><form action="<?php echo $CFG->wwwroot ?>/error/index.php" method="post">
34 <textarea rows="3" cols="50" name="text" id="text"></textarea><br />
35 <input type="hidden" name="referer" value="<?php p($httpreferer) ?>">
36 <input type="hidden" name="requested" value="<?php p($requesturi) ?>">
37 <input type="submit" value="<?php echo get_string('sendmessage', 'error'); ?>">
38 </form>
39 <?php
41 print_footer();