bug fixes

This commit is contained in:
JT Smith 2005-09-09 19:30:28 +00:00
parent 0026b1e73f
commit 0dd6b7b660
12 changed files with 1151 additions and 219 deletions

View file

@ -1,5 +1,14 @@
6.7.4
- fix [ 1279861 ] POD errors in 6.7.3
- Fixed the default assets icon.
- Made further alterations to the page layout templates to make them work
better in IE.
- Added a date caching switch to the config file so people don't have to use
the new date caching system if they don't want to.
- Added an IP based limiter to the debug option, and for that reason
eliminated the unlikely, though potentially dangerous debug=1 URL option.
- Added a performance indicator debug option to the settings.
6.7.3
- User search now includes user alias.

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,832 @@
use lib "../../lib";
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Asset;
my $toVersion = "6.7.4";
my $configFile;
my $quiet;
start();
updatePageTemplates();
addDebug();
finish();
#-------------------------------------------------
sub addDebug {
print "\tAdding more debug options.\n" unless ($quiet);
WebGUI::SQL->write("insert into settings values ('debugIp','')");
WebGUI::SQL->write("insert into settings values ('showPerformanceIndicators','0')");
}
#-------------------------------------------------
sub updatePageTemplates {
print "\tMaking page templates float better in IE.\n" unless ($quiet);
# news
my $template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 50%;
}
.secondColumn {
float: left;
width: auto;
max-width: 50%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<div class="endFloat">&nbsp;</div>
<!-- begin position 2 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<!-- begin position 3 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position3" class="content"><tbody>
</tmpl_if>
<tmpl_loop position3_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div> </div>
<!-- end position 3 -->
<div class="endFloat">&nbsp;</div>
<!-- begin position 4 -->
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position4" class="content"><tbody>
</tmpl_if>
<tmpl_loop position4_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 4 -->
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000094","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# side by side
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 50%;
}
.secondColumn {
float: left;
width: auto;
max-width: 50%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<div class="endFloat">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000135","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# left column
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 33%;
}
.secondColumn {
float: left;
width: auto;
max-width: 65%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<div class="endFloat">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000125","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# right column
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 65%;
}
.secondColumn {
float: left;
width: auto;
max-width: 33%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<div class="endFloat">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000131","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# one over three
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 33%;
}
.secondColumn {
float: left;
width: 33%;
}
.thirdColumn {
float: left;
width: auto;
max-width: 33%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<div class="endFloat">&nbsp;</div>
<!-- begin position 2 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<!-- begin position 3 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position3" class="content"><tbody>
</tmpl_if>
<tmpl_loop position3_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 3 -->
<!-- begin position 4 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position4" class="content"><tbody>
</tmpl_if>
<tmpl_loop position4_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 4 -->
<div class="endFloat">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000109","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# three over one
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 33%;
}
.secondColumn {
float: left;
width: 33%;
}
.thirdColumn {
float: left;
width: auto;
max-width: 33%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<!-- begin position 3 -->
<div class="thirdColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position3" class="content"><tbody>
</tmpl_if>
<tmpl_loop position3_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 3 -->
<div class="endFloat">&nbsp;</div>
<!-- begin position 4 -->
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position4" class="content"><tbody>
</tmpl_if>
<tmpl_loop position4_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 4 -->
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000118","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# three over one
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000054","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
}
#-------------------------------------------------
sub start {
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

View file

@ -45,6 +45,14 @@ fileCacheSizeLimit=100000000
# memcached_servers = 10.0.0.6:11211
# If you enable date caching you can speed up your sites a little
# bit. If you use a lot of events calendars, this is highly
# recommended. However, note that this will likely create
# several hundred megabytes of cache files that are shared
# between your various sites that have date caching enabled
enableDateCache = 0
# Set this to 1 to disable WebGUI's caching subsystems. This is
# mainly useful for developers.

View file

@ -1,5 +1,5 @@
package WebGUI;
our $VERSION = "6.7.3";
our $VERSION = "6.7.4";
our $STATUS = "gamma";
#-------------------------------------------------------------------
@ -120,7 +120,7 @@ sub page {
$output = WebGUI::HTTP::getHeader();
} else {
$output = WebGUI::HTTP::getHeader().$output;
if ($session{setting}{showDebug} || ($session{form}{debug}==1 && WebGUI::Grouping::isInGroup(3))) {
if (WebGUI::ErrorHandler::canShowDebug()) {
$output .= WebGUI::ErrorHandler::showDebug();
}
}

View file

@ -693,8 +693,6 @@ sub getIcon {
my $small = shift;
my $definition = $self->definition;
my $icon = $definition->[0]{icon} || "assets.gif";
return $session{config}{extrasURL}."/adminConsole/small/assets.gif" if ($small and $icon eq "assets.gif");
return $session{config}{extrasURL}."/adminConsole/assets.gif" if ($icon eq "assets.gif");
return $session{config}{extrasURL}.'/assets/small/'.$icon if ($small);
return $session{config}{extrasURL}.'/assets/'.$icon;
}

View file

@ -68,21 +68,27 @@ These functions are available from this package:
sub epochToDate {
my $secs = shift;
my $cache = WebGUI::Cache->new(["epochToDate",$secs],"DateTime");
my $value = $cache->get;
my ($cache, $value);
if ($session{config}{enableDateCache}) {
$cache = WebGUI::Cache->new(["epochToDate",$secs],"DateTime");
$value = $cache->get;
}
return $value if ($value);
my $converted = &ParseDateString("epoch $secs");
$cache->set($converted);
$cache->set($converted) if ($session{config}{enableDateCache});
return $converted;
}
sub dateToEpoch {
my $date = shift;
my $cache = WebGUI::Cache->new(["dateToEpoch",$date],"DateTime");
my $value = $cache->get;
my ($cache, $value);
if ($session{config}{enableDateCache}) {
$cache = WebGUI::Cache->new(["dateToEpoch",$date],"DateTime");
$value = $cache->get;
}
return $value if ($value);
my $converted = &UnixDate($date,"%s");
$cache->set($converted);
$cache->set($converted) if ($session{config}{enableDateCache});
return $converted;
}

View file

@ -78,6 +78,45 @@ sub audit {
}
#-------------------------------------------------------------------
=head canShowDebug ( )
Returns true if the user meets the condition to see debugging information and debug mode is enabled.
=cut
sub canShowDebug {
return (
(
$WebGUI::Session::session{setting}{showDebug}
) && (
$WebGUI::Session::session{setting}{debugIp} =~ /^$WebGUI::Session::session{env}{REMOTE_ADDR}/ ||
$WebGUI::Session::session{setting}{debugIp} eq ""
)
);
}
#-------------------------------------------------------------------
=head canShowPerformanceIndicators ()
Returns true if the user meets the conditions to see performance indicators and performance indicators are enabled.
=cut
sub canShowPerformanceIndicators {
return (
(
$WebGUI::Session::session{setting}{showPerformanceIndicators}
) && (
$WebGUI::Session::session{setting}{debugIp} =~ /^$session{env}{REMOTE_ADDR}/ ||
$WebGUI::Session::session{setting}{debugIp} eq ""
)
);
}
#-------------------------------------------------------------------
=head2 debug ( message )

View file

@ -386,6 +386,16 @@ our $HELP = {
description => '400 description',
namespace => 'WebGUI',
},
{
title => 'debug ip',
description => 'debug ip description',
namespace => 'WebGUI',
},
{
title => 'show performance indicators',
description => 'show performance indicators description',
namespace => 'WebGUI',
},
{
title => '707',
description => '707 description',

View file

@ -172,11 +172,21 @@ sub www_editSettings {
-label=>$i18n->get(400),
-value=>$session{setting}{preventProxyCache}
);
$tabform->getTab("misc")->text(
-name=>"debugIp",
-label=>$i18n->get("debug ip"),
-value=>$session{setting}{debugIp}
);
$tabform->getTab("misc")->yesNo(
-name=>"showDebug",
-label=>$i18n->get(707),
-value=>$session{setting}{showDebug}
);
$tabform->getTab("misc")->yesNo(
-name=>"showPerformanceIndicators",
-label=>$i18n->get('show performance indicators'),
-value=>$session{setting}{showPerformanceIndicators}
);
$tabform->getTab("misc")->selectList(
-name=>"hostToUse",
-value=>[$session{setting}{hostToUse}],

View file

@ -440,7 +440,7 @@ sub prepare {
my $class = shift;
my $sql = shift;
my $dbh = shift || _getDefaultDb();
if ($WebGUI::Session::session{setting}{showDebug}) {
if (WebGUI::ErrorHandler::canShowDebug()) {
push(@{$WebGUI::Session::session{SQLquery}},$sql);
}
my $sth = $dbh->prepare($sql) or WebGUI::ErrorHandler::fatal("Couldn't prepare statement: ".$sql." : ". DBI->errstr);
@ -777,7 +777,7 @@ sub unconditionalRead {
my $sql = shift;
my $dbh = shift || _getDefaultDb();
my $placeholders = shift;
if ($WebGUI::Session::session{setting}{showDebug}) {
if (WebGUI::ErrorHandler::canShowDebug()) {
push(@{$WebGUI::Session::session{SQLquery}},$sql);
}
my $sth = $dbh->prepare($sql) or WebGUI::ErrorHandler::warn("Unconditional read failed: ".$sql." : ".DBI->errstr);
@ -808,7 +808,7 @@ sub write {
my $class = shift;
my $sql = shift;
my $dbh = shift || _getDefaultDb();
if ($WebGUI::Session::session{setting}{showDebug}) {
if (WebGUI::ErrorHandler::canShowDebug()) {
push(@{$WebGUI::Session::session{SQLquery}},$sql);
}
$dbh->do($sql) or WebGUI::ErrorHandler::fatal("Couldn't write to the database: ".$sql." : ". DBI->errstr);

View file

@ -1,6 +1,26 @@
package WebGUI::i18n::English::WebGUI;
our $I18N = {
'show performance indicators' => {
message => q|Show performance indicators?|,
lastUpdated => 0
},
'show performance indicators description' => {
message => q|This will display the time (in seconds) it took to build each item on the page. It's useful for debugging performance problems.|,
lastUpdated => 0
},
'debug ip description' => {
message => q|This will limit debugging output to a specific IP address or IP range. To limit the output to anyone in a subnet of 10.0.0.0/24 you'd simply enter '10.0.0.'.|,
lastUpdated => 0
},
'debug ip' => {
message => q|Debug IP|,
lastUpdated => 0
},
'304' => {
message => q|Language|,
lastUpdated => 1031514049