Enhanced debug for developers.

This commit is contained in:
JT Smith 2003-04-29 04:22:39 +00:00
parent f7b44d12bd
commit 66555e648b
2 changed files with 258 additions and 80 deletions

View file

@ -31,36 +31,10 @@ use WebGUI::Utility;
#-------------------------------------------------------------------
sub _generateDebug {
my ($debug);
if ($session{setting}{showDebug} || ($session{form}{debug}==1 && WebGUI::Privilege::isInGroup(3))) {
$debug = '<div style="background-color: #ffdddd;color: #000000;">'.$session{debug}{warning}.'</div>';
$debug .= '<div style="background-color: #800000;color: #ffffff;">'.$session{debug}{security}.'</div>';
$debug .= '<div style="background-color: #ffffdd;color: #000000;">'.$session{debug}{audit}.'</div>';
$debug .= '<table bgcolor="#ffffff" style="color: #000000; font-size: 10pt; font-family: helvetica;">';
while (my ($section, $hash) = each %session) {
if (ref $hash eq 'HASH') {
while (my ($key, $value) = each %$hash) {
if (ref $value eq 'ARRAY') {
$value = '['.join(', ',@$value).']';
} elsif (ref $value eq 'HASH') {
$value = '{'.join(', ',map {"$_ => $value->{$_}"} keys %$value).'}';
}
unless (lc($key) eq "password" || lc($key) eq "identifier") {
$debug .= '<tr><td align="right"><b>'.$section.'.'.$key.':</b></td><td>'.$value.'</td>';
}
}
} elsif (ref $hash eq 'ARRAY') {
my $i = 1;
foreach (@$hash) {
$debug .= '<tr><td align="right"><b>'.$section.'.'.$i.':</b></td><td>'.$_.'</td>';
$i++;
}
}
$debug .= '<tr><td colspan="2">&nbsp;</td></tr>';
}
$debug .='</table>';
return WebGUI::ErrorHandler::showDebug();
}
return $debug;
return "";
}
#-------------------------------------------------------------------