File:
[LON-CAPA] /
loncom /
interface /
lonerrorhandler.pm
Revision
1.4:
download - view:
text,
annotated -
select for diffs
Tue Aug 5 12:52:23 2003 UTC (21 years, 1 month ago) by
www
Branches:
MAIN
CVS tags:
version_1_3_X,
version_1_3_3,
version_1_3_2,
version_1_3_1,
version_1_3_0,
version_1_2_X,
version_1_2_99_1,
version_1_2_99_0,
version_1_2_1,
version_1_2_0,
version_1_1_X,
version_1_1_99_5,
version_1_1_99_4,
version_1_1_99_3,
version_1_1_99_2,
version_1_1_99_1,
version_1_1_99_0,
version_1_1_3,
version_1_1_2,
version_1_1_1,
version_1_1_0,
version_1_0_99_3,
version_1_0_99_2,
version_1_0_99_1,
version_1_0_99,
version_1_0_3,
version_1_0_2,
version_1_0_1,
version_1_0_0,
version_0_99_5,
version_0_99_4,
HEAD
Bug #1968: version information more easily available
1: # The LearningOnline Network
2: # Internal Server Error Handler
3: #
4: # $Id: lonerrorhandler.pm,v 1.4 2003/08/05 12:52:23 www Exp $
5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
28:
29: package Apache::lonerrorhandler;
30:
31: use strict;
32: use Apache::Constants qw(:common);
33: use Apache::loncommon;
34:
35: sub handler {
36: my $r = shift;
37: $r->content_type('text/html');
38: $r->send_http_header;
39: return OK if $r->header_only;
40:
41: # ------------------------------------------------------------- Get environment
42: my $envkey;
43: my $env='';
44:
45: foreach $envkey (sort keys %ENV) {
46: $env.="$envkey: $ENV{$envkey}\n";
47: }
48:
49: $env=~s/\"/\'\'/g;
50: my $recipients=$r->dir_config('lonAdmEMail').','.
51: $r->dir_config('lonSysEMail');
52:
53: my $version=$r->dir_config('lonVersion');
54:
55: my $req=$r->as_string();
56: $req=~s/\"/\'\'/g;
57:
58: my $bodytag=&Apache::loncommon::bodytag('Could Not Process Request');
59: # --------------------------------------------------- Print login screen header
60: $r->print(<<ENDDOCUMENT);
61: <html>
62: <head>
63: <title>The LearningOnline Network with CAPA</title>
64: </head>
65: $bodytag
66: <h2>Somewhere something went wrong - please help us to find out what.</h2>
67: Please take a moment to fill out the form below. Your information, together
68: with internal debugging information, will be emailed to the system and server
69: administrators.
70: <form action="mailto:$recipients" method=get enctype="text/plain">
71: <input type=submit value="Send Information">
72: <h3>Please describe what you did just before this screen came up</h3>
73: <input type=hidden name=req value="$req">
74: <textarea name=prioraction cols=50 rows=5>
75: </textarea>
76: <h3>Is this problem reproducible?</h3>
77: <input type=checkbox name=reproducible value=yes> Yes!
78: <h3>Do you have any guesses why this might have happened?</h3>
79: <textarea name=guesses cols=50 rows=5>
80: </textarea>
81: <input type=hidden name=version value="$version">
82: <input type=hidden name=environment value="$env"><p>
83: <input type=submit value="Send Information">
84: </form>
85: <h1>Thank you for your help!</h1>
86: </body>
87: </html>
88: ENDDOCUMENT
89: # -------------------------- Better terminate this in case something was sticky
90: $r->child_terminate();
91:
92: return OK;
93: }
94:
95: 1;
96: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>