Skip to content

Commit 9a09ec0

Browse files
committedMar 11, 2012
sslEnabled in the config file trumps encryptLogin in the settings.
1 parent b39a7d5 commit 9a09ec0

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed
 

‎docs/changelog/7.x.x.txt

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- fixed #12328: invalid wgaccess file in uploads
99
- RFE: 9730 (actually missing documentation)
1010
- fixed: Crud updateFromFormPost
11+
- fixed: encryptLogin and sslEnabled both need to be true
1112

1213
7.10.24
1314
- fixed #12318: asset error causes asset manager to fail

‎lib/WebGUI/Auth.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ sub displayLogin {
589589
my $i18n = WebGUI::International->new($self->session);
590590
$vars->{title} = $i18n->get(66);
591591
my $action;
592-
if ($self->session->setting->get("encryptLogin")) {
592+
if ($self->session->config->get('sslEnabled') && $self->session->setting->get("encryptLogin")) {
593593
my $uri = URI->new($self->session->url->page(undef,1));
594594
$uri->scheme('https');
595595
$uri->host_port($uri->host);
@@ -924,7 +924,7 @@ sub login {
924924
$self->session->http->setRedirect($self->session->setting->get("redirectAfterLoginUrl"));
925925
$self->session->scratch->delete("redirectAfterLogin");
926926
}
927-
elsif ($self->session->setting->get('encryptLogin')) {
927+
elsif ($self->session->config->get('sslEnabled') && $self->session->setting->get('encryptLogin')) {
928928
my $currentUrl = URI->new($self->session->url->page(undef,1));
929929
$currentUrl->scheme('http');
930930
$currentUrl->port($self->session->config->get('webServerPort') || 80);
@@ -1109,7 +1109,7 @@ sub showMessageOnLogin {
11091109
|| $session->url->getBackToSiteURL
11101110
;
11111111

1112-
if ($session->setting->get('encryptLogin') && ( ! $redirectUrl =~ /^http/)) {
1112+
if ($self->session->config->get('sslEnabled') && $session->setting->get('encryptLogin') && ( ! $redirectUrl =~ /^http/)) {
11131113
##A scheme-less URL has been supplied. We need to make it an absolute one
11141114
##with a non-encrypted scheme. Otherwise the user will stay in SSL mode.
11151115
##We assume that the user put the gateway URL into their URL.

‎lib/WebGUI/Macro/L_loginBox.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ sub process {
9696
}
9797

9898
my $action;
99-
if ($session->setting->get("encryptLogin")) {
99+
if ($session->config->get('sslEnabled') && $session->setting->get("encryptLogin")) {
100100
my $uri = URI->new($session->url->page(undef,1));
101101
$uri->scheme('https');
102102
$uri->host_port($uri->host);

‎t/Macro/L_loginBox.t

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ is($url2, $session->url->page("op=auth;method=logout"), "templated custom text,
150150

151151
##Change settings to use encrypt login and verify which links use https.
152152
$session->setting->set("encryptLogin", 1);
153+
WebGUI::Test->originalConfig('sslEnabled');
154+
$session->config->set('sslEnabled', 1);
153155

154156
$output = WebGUI::Macro::L_loginBox::process($session,'','',$template->getId);
155157
%vars = simpleTextParser($output);

0 commit comments

Comments
 (0)
Please sign in to comment.