debug can now handle multiple ips

This commit is contained in:
JT Smith 2005-12-04 04:40:48 +00:00
parent 09b615d15f
commit 2315f5edc3
2 changed files with 17 additions and 12 deletions

View file

@ -37,10 +37,12 @@
"dashboard". You can create more than one dashboard per site.
See the help documention for how to use Shortcut overrides and the
new user preference fields.
- [ 1361669 ] editUserProfileField causes huge memory consumption, loop
- [ 1354464 ] Dynamic Field does not work correctly
- [ 1354467 ] WebGUI::Form::Group is implemented incorrectly
- [ 1372045 ] Required user profile field not show when create login
- [ 1361669 ] editUserProfileField causes huge memory consumption, loop
- [ 1354464 ] Dynamic Field does not work correctly
- [ 1354467 ] WebGUI::Form::Group is implemented incorrectly
- [ 1372045 ] Required user profile field not show when create login
- Added an option for multiple IP addresses (space seperated) for debug
output
6.7.8

View file

@ -87,14 +87,17 @@ Returns true if the user meets the condition to see debugging information and de
=cut
sub canShowDebug {
return (
(
$WebGUI::Session::session{setting}{showDebug}
) && (
$WebGUI::Session::session{env}{REMOTE_ADDR} =~ /^$WebGUI::Session::session{setting}{debugIp}/ ||
$WebGUI::Session::session{setting}{debugIp} eq ""
)
);
return 0 unless ($WebGUI::Session::session{setting}{showDebug});
return 1 if ($WebGUI::Session::session{setting}{debugIp} eq "");
my @ips = split(" ",$WebGUI::Session::session{setting}{debugIp});
my $ok = 0;
foreach my $ip (@ips) {
if ($WebGUI::Session::session{env}{REMOTE_ADDR} =~ /^$ip/) {
$ok = 1;
last;
}
}
return $ok;
}
#-------------------------------------------------------------------