WebGUI 3.6.0 release
This commit is contained in:
parent
81da4fe3af
commit
0997fc100c
22 changed files with 3085 additions and 103 deletions
|
|
@ -15,9 +15,10 @@ use WebGUI::Session;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub fatalError {
|
||||
my ($key, $log, $cgi, $logfile, $config);
|
||||
my ($key, $log, $cgi, $logfile, $config, $friendly);
|
||||
if (exists $session{cgi}) {
|
||||
$cgi = $session{cgi};
|
||||
$friendly = 1 if ($session{setting}{onCriticalError} eq "friendly");
|
||||
} else {
|
||||
use CGI;
|
||||
$cgi = CGI->new;
|
||||
|
|
@ -30,35 +31,41 @@ sub fatalError {
|
|||
$config = new Data::Config '../etc/WebGUI.conf';
|
||||
$logfile = $config->param('logfile');
|
||||
}
|
||||
$log = FileHandle->new(">>$logfile") or die "Can't open log file.";
|
||||
print "<h1>WebGUI Fatal Error</h1>Something unexpected happened that caused this system to fault.<p>";
|
||||
print $0." at ".localtime(time)." reported:<br>";
|
||||
print "<h1>WebGUI Fatal Error</h1>Something unexpected happened that caused this system to fault.<p>" unless ($friendly);
|
||||
$log = FileHandle->new(">>$logfile") or print "Can't open log file.";
|
||||
print $0." at ".localtime(time)." reported:<br>" unless ($friendly);
|
||||
print $log localtime(time)." ".$0." ".$_[0]."\n";
|
||||
print $_[0];
|
||||
print "<p><h3>Caller</h3><table border=1><tr><td valign=top>";
|
||||
print "<b>Level 1</b><br>".join("<br>",caller(1));
|
||||
print $_[0] unless ($friendly);
|
||||
print "<p><h3>Caller</h3><table border=1><tr><td valign=top>" unless ($friendly);
|
||||
print "<b>Level 1</b><br>".join("<br>",caller(1)) unless ($friendly);
|
||||
print $log "\t".join(",",caller(1))."\n";
|
||||
print "</td><td valign=top>"."<b>Level 2</b><br>".join("<br>",caller(2));
|
||||
print "</td><td valign=top>"."<b>Level 2</b><br>".join("<br>",caller(2)) unless ($friendly);
|
||||
print $log "\t".join(",",caller(2))."\n";
|
||||
print "</td><td valign=top>"."<b>Level 3</b><br>".join("<br>",caller(3));
|
||||
print "</td><td valign=top>"."<b>Level 3</b><br>".join("<br>",caller(3)) unless ($friendly);
|
||||
print $log "\t".join(",",caller(3))."\n";
|
||||
print "</td><td valign=top>"."<b>Level 4</b><br>".join("<br>",caller(4));
|
||||
print "</td><td valign=top>"."<b>Level 4</b><br>".join("<br>",caller(4)) unless ($friendly);
|
||||
print $log "\t".join(",",caller(4))."\n";
|
||||
print "</td></tr></table>";
|
||||
print "<h3>Form Variables</h3>";
|
||||
print "</td></tr></table>" unless ($friendly);
|
||||
print "<h3>Form Variables</h3>" unless ($friendly);
|
||||
print $log "\t";
|
||||
if (exists $session{form}) {
|
||||
foreach $key (keys %{$session{form}}) {
|
||||
print $key." = ".$session{form}{$key}."<br>";
|
||||
print $key." = ".$session{form}{$key}."<br>" unless ($friendly);
|
||||
print $log $key."=".$session{form}{$key}." ";
|
||||
}
|
||||
print $log "\n";
|
||||
} else {
|
||||
print "Cannot retrieve session information.";
|
||||
print "Cannot retrieve session information." unless ($friendly);
|
||||
print $log "Session not accessible for form variable dump.\n";
|
||||
}
|
||||
print $log "\n";
|
||||
$log->close;
|
||||
if ($friendly) {
|
||||
print WebGUI::International::get(416).'<br>';
|
||||
print '<br>'.$session{setting}{companyName};
|
||||
print '<br>'.$session{setting}{companyEmail};
|
||||
print '<br>'.$session{setting}{companyURL};
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue