added a switch to fix load balancer problem
This commit is contained in:
parent
c8d10a9d09
commit
f38f12e832
5 changed files with 30 additions and 7 deletions
|
|
@ -3,6 +3,8 @@
|
||||||
- Made the username field in the database unique.
|
- Made the username field in the database unique.
|
||||||
- Added sorting options to USS.
|
- Added sorting options to USS.
|
||||||
- Added external database group privileges. (Thanks to Andy Grundman.)
|
- 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 support for encryptLogin user setting. (Thanks to Hal Roberts.)
|
||||||
- Added anonymous response option to Survey. (Thanks to Andy Grundman.)
|
- Added anonymous response option to Survey. (Thanks to Andy Grundman.)
|
||||||
- Added the alphabetic? option to the SiteMap wobject. (Thanks to Hal Roberts.)
|
- Added the alphabetic? option to the SiteMap wobject. (Thanks to Hal Roberts.)
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -120,6 +120,15 @@ sub www_editMiscSettings {
|
||||||
$f->yesNo("preventProxyCache",WebGUI::International::get(400),$session{setting}{preventProxyCache});
|
$f->yesNo("preventProxyCache",WebGUI::International::get(400),$session{setting}{preventProxyCache});
|
||||||
$f->yesNo("showDebug",WebGUI::International::get(707),$session{setting}{showDebug});
|
$f->yesNo("showDebug",WebGUI::International::get(707),$session{setting}{showDebug});
|
||||||
$f->yesNo("trackPageStatistics",WebGUI::International::get(749),$session{setting}{trackPageStatistics});
|
$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;
|
$f->submit;
|
||||||
$output .= $f->print;
|
$output .= $f->print;
|
||||||
return _submenu($output);
|
return _submenu($output);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ use strict;
|
||||||
use Tie::CPHash;
|
use Tie::CPHash;
|
||||||
use WebGUI::ErrorHandler;
|
use WebGUI::ErrorHandler;
|
||||||
use WebGUI::SQL;
|
use WebGUI::SQL;
|
||||||
use WebGUI::URL;
|
|
||||||
use WebGUI::Utility;
|
use WebGUI::Utility;
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,14 @@ These subroutines are available from this package:
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub _getSiteURL {
|
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://";
|
my $proto = "http://";
|
||||||
if ($WebGUI::Session::session{env}{SERVER_PORT} == 443) {
|
if ($session{env}{SERVER_PORT} == 443) {
|
||||||
$proto = "https://";
|
$proto = "https://";
|
||||||
}
|
}
|
||||||
return $proto.$site;
|
return $proto.$site;
|
||||||
|
|
@ -137,11 +142,11 @@ Name value pairs to add to the URL in the form of:
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub gateway {
|
sub gateway {
|
||||||
my $url = _getSiteURL().$WebGUI::Session::session{config}{scripturl}.'/'.$_[0];
|
my $url = _getSiteURL().$session{config}{scripturl}.'/'.$_[0];
|
||||||
if ($_[1]) {
|
if ($_[1]) {
|
||||||
$url = append($url,$_[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());
|
$url = append($url,"noCache=".randint(0,1000).';'.time());
|
||||||
}
|
}
|
||||||
return $url;
|
return $url;
|
||||||
|
|
@ -195,11 +200,11 @@ Name value pairs to add to the URL in the form of:
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub page {
|
sub page {
|
||||||
my $url = _getSiteURL().$WebGUI::Session::session{page}{url};
|
my $url = _getSiteURL().$session{page}{url};
|
||||||
if ($_[0]) {
|
if ($_[0]) {
|
||||||
$url = append($url,$_[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());
|
$url = append($url,"noCache=".randint(0,1000).';'.time());
|
||||||
}
|
}
|
||||||
return $url;
|
return $url;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue