Cart now redirects to ssl if the site is ssl enabled.
This commit is contained in:
parent
026e77663e
commit
eff953b5ed
3 changed files with 43 additions and 1 deletions
|
|
@ -28,6 +28,8 @@
|
||||||
- fixed: Ribbons and Tokens on badge page error
|
- fixed: Ribbons and Tokens on badge page error
|
||||||
- fixed: Variable 'description' not filled in RSS templates
|
- fixed: Variable 'description' not filled in RSS templates
|
||||||
- fixed: logging reports incorrect location
|
- fixed: logging reports incorrect location
|
||||||
|
- fixed: Cart now redirects to ssl if the site is ssl enabled.
|
||||||
|
- added: Session/Url now has a forceToSecure method which takes a page or site url and redirects to that page or url if the site is ssl enabled.
|
||||||
|
|
||||||
7.5.17
|
7.5.17
|
||||||
- fixed: Payment Methods Hover Help Incomplete
|
- fixed: Payment Methods Hover Help Incomplete
|
||||||
|
|
|
||||||
|
|
@ -241,6 +241,43 @@ sub getRefererUrl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 forceSecureConnection( url )
|
||||||
|
|
||||||
|
Attempts to create an SSL connection with the current or passed in url.
|
||||||
|
|
||||||
|
=head3 url
|
||||||
|
|
||||||
|
The optional url that the page should forward to as an SSL connection.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub forceSecureConnection{
|
||||||
|
my $self = shift;
|
||||||
|
my $url = shift;
|
||||||
|
my ($conf, $env, $http) = $self->session->quick(qw(config env http));
|
||||||
|
|
||||||
|
if ($conf->get("sslEnabled") && $env->get("HTTPS") ne "on" && !$env->get("SSLPROXY")){
|
||||||
|
|
||||||
|
$url = $self->session->url->page if(! $url);
|
||||||
|
$url = $self->session->env->get('QUERY_STRING') if(! $url);
|
||||||
|
|
||||||
|
if($url !~ /^$self->getSiteURL()/i){
|
||||||
|
$url = $self->getSiteURL() . $url;
|
||||||
|
}
|
||||||
|
if($env->get('QUERY_STRING')){
|
||||||
|
$url .= "?". $env->get('QUERY_STRING');
|
||||||
|
}
|
||||||
|
if($url =~ /^http/i) {
|
||||||
|
$url =~ s/^https?/https/i;
|
||||||
|
$http->setRedirect($url);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -678,7 +678,10 @@ sub www_view {
|
||||||
my $url = $session->url;
|
my $url = $session->url;
|
||||||
my $i18n = WebGUI::International->new($session, "Shop");
|
my $i18n = WebGUI::International->new($session, "Shop");
|
||||||
my @items = ();
|
my @items = ();
|
||||||
|
|
||||||
|
if($url->forceSecureConnection()){
|
||||||
|
return "redirect";
|
||||||
|
}
|
||||||
# set up html header
|
# set up html header
|
||||||
$session->style->setRawHeadTags(q|
|
$session->style->setRawHeadTags(q|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue