Annotation of loncom/interface/lonerrorhandler.pm, revision 1.4

1.1       www         1: # The LearningOnline Network
                      2: # Internal Server Error Handler
                      3: #
1.4     ! www         4: # $Id: lonerrorhandler.pm,v 1.3 2001/12/19 17:17:46 albertel Exp $
1.3       albertel    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: #
1.4     ! www        28: 
1.1       www        29: package Apache::lonerrorhandler;
                     30: 
                     31: use strict;
                     32: use Apache::Constants qw(:common);
1.4     ! www        33: use Apache::loncommon;
1.1       www        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: 
1.2       www        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: 
1.4     ! www        53:      my $version=$r->dir_config('lonVersion');
        !            54: 
1.2       www        55:      my $req=$r->as_string();
                     56:      $req=~s/\"/\'\'/g;
                     57: 
1.4     ! www        58:     my $bodytag=&Apache::loncommon::bodytag('Could Not Process Request');
1.1       www        59: # --------------------------------------------------- Print login screen header
                     60:     $r->print(<<ENDDOCUMENT);
                     61: <html>
                     62: <head>
                     63: <title>The LearningOnline Network with CAPA</title>
                     64: </head>
1.4     ! www        65: $bodytag
1.2       www        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>
1.4     ! www        81: <input type=hidden name=version value="$version">
1.2       www        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>
1.1       www        86: </body>
                     87: </html>
                     88: ENDDOCUMENT
1.2       www        89: # -------------------------- Better terminate this in case something was sticky
                     90:     $r->child_terminate();
                     91: 
1.1       www        92:     return OK;
                     93: } 
                     94: 
                     95: 1;
                     96: __END__

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>