Skip to content

Commit

Permalink
Code Review from jpwhite4
Browse files Browse the repository at this point in the history
  • Loading branch information
plessbd committed Oct 15, 2018
1 parent 81fb137 commit 747a21d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 41 deletions.
6 changes: 3 additions & 3 deletions configuration/portal_settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ multiple_service_providers = "off"

[sso]
force_default_organization = "on"
; used to collapse the local sign in portion of the sign in modal
; setting to false will show it.
collapse_local_login = "true"
; used to show local sign in portion of the sign in modal
; setting to true will show it.
show_local_login = "false"

[internal]
dw_desc_cache = "off"
Expand Down
59 changes: 30 additions & 29 deletions html/gui/js/CCR.js
Original file line number Diff line number Diff line change
Expand Up @@ -1023,40 +1023,41 @@ CCR.xdmod.ui.actionLogin = function (config, animateTarget) {
},
hidden: true
},
new Ext.Container({
{
xtype: 'container',
anchor: 'form',
autoWidth: true,
height: 38,
layout: {
type: 'hbox'
},
items: [
new Ext.Button({
width: 75,
height: 22,
text: 'Sign in',
id: 'btn_sign_in',
handler: signInWithLocalAccount
}),
new Ext.Container({
autoEl: 'div',
autoWidth: true,
flex: 2,
height: 38,
id: 'assistancePrompt',
items: [{
xtype: 'tbtext',
html: '<a href="javascript:CCR.xdmod.ui.forgot_password()">Forgot your password?</a>',
id: 'forgot_password_link'
},
{
xtype: 'tbtext',
html: '<a href="javascript:presentSignUpViaLoginPrompt()">Don\'t have an account?</a>',
id: 'sign_up_link'
}]
})
]
})
items: [{
xtype: 'button',
width: 75,
height: 22,
text: 'Sign in',
id: 'btn_sign_in',
handler: signInWithLocalAccount
},
{
xtype: 'container',
autoEl: 'div',
autoWidth: true,
flex: 2,
height: 38,
id: 'assistancePrompt',
items: [{
xtype: 'tbtext',
html: '<a href="javascript:CCR.xdmod.ui.forgot_password()">Forgot your password?</a>',
id: 'forgot_password_link'
},
{
xtype: 'tbtext',
html: '<a href="javascript:presentSignUpViaLoginPrompt()">Don\'t have an account?</a>',
id: 'sign_up_link'
}]
}]
}
];

var SSOLoginFrm = CCR.xdmod.isSSOConfigured ? new Ext.form.FormPanel({
Expand Down Expand Up @@ -1113,7 +1114,7 @@ CCR.xdmod.ui.actionLogin = function (config, animateTarget) {

if (CCR.xdmod.isSSOConfigured) {
loginItems.push(SSOLoginFrm);
if (CCR.xdmod.SSOcollapseLocalLogin) {
if (!CCR.xdmod.SSOShowLocalLogin) {
localLoginFrm.collapsible = true;
localLoginFrm.collapsed = true;
localLoginFrm.titleCollapse = true;
Expand Down
12 changes: 6 additions & 6 deletions html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,18 +312,18 @@ function isReferrer($referrer)
// This will catch when a configuration directory does not exist if it is set in the environment level
}
if ($auth && $auth->isSamlConfigured()) {
$ssoCollapse = 'true';
$ssoShowLocalLogin = false;
try {
$ssoCollapseSetting = filter_var(xd_utilities\getConfiguration('sso', 'collapse_local_login'), FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE));
if($ssoCollapseSetting === false){
$ssoCollapse = 'false';
}
$ssoShowLocalLogin = filter_var(
xd_utilities\getConfiguration('sso', 'show_local_login'),
FILTER_VALIDATE_BOOLEAN
);
} catch (exception $ex) {
}

print "CCR.xdmod.isSSOConfigured = true;\n";
print "CCR.xdmod.SSOLoginLink = " . json_encode($auth->getLoginLink()) . ";\n";
print "CCR.xdmod.SSOcollapseLocalLogin = " . $ssoCollapse . "\n";
print "CCR.xdmod.SSOShowLocalLogin = " . json_encode($ssoShowLocalLogin) . "\n";
} else {
print "CCR.xdmod.isSSOConfigured = false;\n";
}
Expand Down
6 changes: 3 additions & 3 deletions templates/portal_settings.template
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ multiple_service_providers = "off"

[sso]
force_default_organization = "on"
; used to collapse the local sign in portion of the sign in modal
; setting to false will show it.
collapse_local_login = "true"
; used to show local sign in portion of the sign in modal
; setting to true will show it.
show_local_login = "false"

[internal]
dw_desc_cache = "off"
Expand Down

0 comments on commit 747a21d

Please sign in to comment.