File:  [LON-CAPA] / loncom / interface / lonerrorhandler.pm
Revision 1.6: download - view: text, annotated - select for diffs
Thu Feb 17 08:50:20 2005 UTC (19 years, 4 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
- $r->content_type -> loncommon::content_type

    1: # The LearningOnline Network
    2: # Internal Server Error Handler
    3: #
    4: # $Id: lonerrorhandler.pm,v 1.6 2005/02/17 08:50:20 albertel 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:     &Apache::loncommon::content_type($r,'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 $html=&Apache::lonxml::xmlbegin();
   59:     my $bodytag=&Apache::loncommon::bodytag('Could Not Process Request');
   60: # --------------------------------------------------- Print login screen header
   61:     $r->print(<<ENDDOCUMENT);
   62: $html
   63: <head>
   64: <title>The LearningOnline Network with CAPA</title>
   65: </head>
   66: $bodytag
   67: <h2>Somewhere something went wrong - please help us to find out what.</h2>
   68: Please take a moment to fill out the form below. Your information, together
   69: with internal debugging information, will be emailed to the system and server
   70: administrators.
   71: <form action="mailto:$recipients" method=get enctype="text/plain">
   72: <input type=submit value="Send Information">
   73: <h3>Please describe what you did just before this screen came up</h3>
   74: <input type=hidden name=req value="$req">
   75: <textarea name=prioraction cols=50 rows=5>
   76: </textarea>
   77: <h3>Is this problem reproducible?</h3>
   78: <input type=checkbox name=reproducible value=yes> Yes!
   79: <h3>Do you have any guesses why this might have happened?</h3>
   80: <textarea name=guesses cols=50 rows=5>
   81: </textarea>
   82: <input type=hidden name=version value="$version">
   83: <input type=hidden name=environment value="$env"><p>
   84: <input type=submit value="Send Information">
   85: </form>
   86: <h1>Thank you for your help!</h1>
   87: </body>
   88: </html>
   89: ENDDOCUMENT
   90: # -------------------------- Better terminate this in case something was sticky
   91:     $r->child_terminate();
   92: 
   93:     return OK;
   94: } 
   95: 
   96: 1;
   97: __END__

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