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

@ -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;