added a switch to fix load balancer problem

This commit is contained in:
JT Smith 2003-10-20 15:56:43 +00:00
parent c8d10a9d09
commit f38f12e832
5 changed files with 30 additions and 7 deletions

View file

@ -3,6 +3,8 @@
- Made the username field in the database unique.
- Added sorting options to USS.
- Added external database group privileges. (Thanks to Andy Grundman.)
- Added a switch to the miscellaneous settings that allows the admin to set
how URLs are generated to fix a problem with sites behind load balancers.
- Added support for encryptLogin user setting. (Thanks to Hal Roberts.)
- Added anonymous response option to Survey. (Thanks to Andy Grundman.)
- Added the alphabetic? option to the SiteMap wobject. (Thanks to Hal Roberts.)

File diff suppressed because one or more lines are too long

View file

@ -120,6 +120,15 @@ sub www_editMiscSettings {
$f->yesNo("preventProxyCache",WebGUI::International::get(400),$session{setting}{preventProxyCache});
$f->yesNo("showDebug",WebGUI::International::get(707),$session{setting}{showDebug});
$f->yesNo("trackPageStatistics",WebGUI::International::get(749),$session{setting}{trackPageStatistics});
$f->selectList(
-name=>"hostToUse",
-value=>[$session{setting}{hostToUse}],
-options=>{
sitename=>WebGUI::International::get(1070),
HTTP_HOST=>WebGUI::International::get(1071)
},
-label=>WebGUI::International::get(1069)
);
$f->submit;
$output .= $f->print;
return _submenu($output);

View file

@ -24,7 +24,6 @@ use strict;
use Tie::CPHash;
use WebGUI::ErrorHandler;
use WebGUI::SQL;
use WebGUI::URL;
use WebGUI::Utility;
our @ISA = qw(Exporter);

View file

@ -50,9 +50,14 @@ These subroutines are available from this package:
#-------------------------------------------------------------------
sub _getSiteURL {
my $site = $WebGUI::Session::session{env}{HTTP_HOST} || $WebGUI::Session::session{config}{sitename};
my $site;
if ($session{setting}{hostToUse} eq "sitename") {
$site = $session{config}{sitename} || $session{env}{HTTP_HOST};
} else {
$site = $session{env}{HTTP_HOST} || $session{config}{sitename};
}
my $proto = "http://";
if ($WebGUI::Session::session{env}{SERVER_PORT} == 443) {
if ($session{env}{SERVER_PORT} == 443) {
$proto = "https://";
}
return $proto.$site;
@ -137,11 +142,11 @@ Name value pairs to add to the URL in the form of:
=cut
sub gateway {
my $url = _getSiteURL().$WebGUI::Session::session{config}{scripturl}.'/'.$_[0];
my $url = _getSiteURL().$session{config}{scripturl}.'/'.$_[0];
if ($_[1]) {
$url = append($url,$_[1]);
}
if ($WebGUI::Session::session{setting}{preventProxyCache} == 1) {
if ($session{setting}{preventProxyCache} == 1) {
$url = append($url,"noCache=".randint(0,1000).';'.time());
}
return $url;
@ -195,11 +200,11 @@ Name value pairs to add to the URL in the form of:
=cut
sub page {
my $url = _getSiteURL().$WebGUI::Session::session{page}{url};
my $url = _getSiteURL().$session{page}{url};
if ($_[0]) {
$url = append($url,$_[0]);
}
if ($WebGUI::Session::session{setting}{preventProxyCache} == 1) {
if ($session{setting}{preventProxyCache} == 1) {
$url = append($url,"noCache=".randint(0,1000).';'.time());
}
return $url;