diff options
author | Robert Zorko <robertz@gurucue.com> | 2015-10-21 13:57:43 +0200 |
---|---|---|
committer | Robert Zorko <robertz@gurucue.com> | 2015-10-21 13:57:43 +0200 |
commit | fbcca83fc33f3a622364ae90c5d82bbbdc9a9dc6 (patch) | |
tree | b82b7f63991c024e7ac33e093121b8d94e181227 | |
parent | 08e955335ecb65c308dbc68bf0610dce39ce3623 (diff) |
global saml_logout has been disabled. A bug with the saml login timeout has been fixed (if the user entered the saml login screen and went back he would later get the timeout error)
-rw-r--r-- | js/codeq/aaiLogin.js | 9 | ||||
-rw-r--r-- | js/codeq/comms.js | 4 | ||||
-rw-r--r-- | js/codeq/core.js | 2 | ||||
-rw-r--r-- | js/codeq/login.js | 4 | ||||
-rw-r--r-- | js/codeq/navigation.js | 26 | ||||
-rw-r--r-- | js/codeq/profile.js | 2 |
6 files changed, 42 insertions, 5 deletions
diff --git a/js/codeq/aaiLogin.js b/js/codeq/aaiLogin.js index 7e48486..5d4f1c9 100644 --- a/js/codeq/aaiLogin.js +++ b/js/codeq/aaiLogin.js @@ -14,6 +14,7 @@ codeq.globalStateMachine.register('aailogin',{ 'enter': function(){ jqDisabledOverlay.css('display', ''); + codeq.samlLogin = true;//set the flag $('.saml-login-hide').css('display','none');//hide the change password buttons, in the case we go back to the normal login page (cancel or error) they will be reset to being visible when we enter the normal login state jqNavigationHomeBtn.off('click');//remove the click listener of this element here jqNavBarRight.css('display','none');//hide settings etc. @@ -34,9 +35,11 @@ }) .then(codeq.loginCallbackFunction) .fail(function(reason){ - codeq.log.error('SAML login failed: ' + reason); - alert('SAML login failed: ' + reason); - codeq.globalStateMachine.transition('login'); + if(codeq.samlLogin){//if the user goes back to the normal login screen the timeout (which will happen) mustn't do anything + codeq.log.error('SAML login failed: ' + reason); + alert('SAML login failed: ' + reason); + codeq.globalStateMachine.transition('login'); + } }) .done(); diff --git a/js/codeq/comms.js b/js/codeq/comms.js index fe609c9..306263c 100644 --- a/js/codeq/comms.js +++ b/js/codeq/comms.js @@ -535,6 +535,10 @@ 'samlLogin': function(){ return this.send({'action':'saml_login','gui_lang':codeq.getLang()}); + }, + + 'samlLogout': function(){ + return this.send({'action':'saml_logout'}); } }; })(); diff --git a/js/codeq/core.js b/js/codeq/core.js index 309195b..e4ead27 100644 --- a/js/codeq/core.js +++ b/js/codeq/core.js @@ -377,6 +377,8 @@ 'log': log, + 'samlLogin' : false,//falg if we logged in via saml + 'settings': { 'gui_lang': 'en', // boot sequence overrides this if the browser uses a supported language 'gui_layout': 'line-layout' diff --git a/js/codeq/login.js b/js/codeq/login.js index db90b43..b2c39dd 100644 --- a/js/codeq/login.js +++ b/js/codeq/login.js @@ -43,7 +43,6 @@ }; var loginFun = function(){ - $('.saml-login-hide').css('display','');//if we login the normal way we want to show the change password buttons. if we enter the saml login they will be hidden jqDisabled.css('display', ''); jqDisabled.css('cursor', 'wait'); codeq.comms.connect() @@ -68,6 +67,9 @@ jqNavBarRight.css('display','none');//hide settings etc. $('#signed-in-title').html(''); + codeq.samlLogin = false;//remove saml login flag + $('.saml-login-hide').css('display','');//if we login the normal way we want to show the change password buttons. if we enter the saml login they will be hidden + //setup the signup button jqSignupBtn.on('click', function(e){ codeq.globalStateMachine.transition('signup'); diff --git a/js/codeq/navigation.js b/js/codeq/navigation.js index 9483e05..7fc3697 100644 --- a/js/codeq/navigation.js +++ b/js/codeq/navigation.js @@ -107,7 +107,6 @@ e.preventDefault(); }); $('#navigation-logout').on('click', function(e){ - codeq.globalStateMachine.transition('login'); codeq.comms.logout() .then(function (data) { @@ -119,6 +118,31 @@ }) .done(); + /*leaving this here if we later decide to enable saml_logout + if(codeq.samlLogin){ + codeq.comms.samlLogout() + .then(function (data) { + console.log(data); + codeq.comms.disconnect(); + }) + .fail(function (reason) { + console.log(reason); + }) + .done(); + }else{ + codeq.comms.logout() + .then(function (data) { + console.log(data); + codeq.comms.disconnect(); + }) + .fail(function (reason) { + console.log(reason); + }) + .done(); + }*/ + + codeq.globalStateMachine.transition('login'); + //codeq.globalStateMachine.transition('login'); e.preventDefault();//prevent this since we'll trigger a page reload otherwise }); diff --git a/js/codeq/profile.js b/js/codeq/profile.js index 36c5ccf..f666697 100644 --- a/js/codeq/profile.js +++ b/js/codeq/profile.js @@ -18,6 +18,7 @@ jqBtnGoBack.on('click',function(){
history.back();//forces a transition to the previous state
});
+ if(codeq.samlLogin) $('#loggedInViaSamlSpan').css("display","");//show the span if we actually logged in with SAML
$("#screen_profile").css('display', '');
$('#disabled').css('display', 'none');
codeq.comms.getUserStat()
@@ -64,6 +65,7 @@ jqBtnChangePass.off('click');
jqBtnGoBack.off('click');
$("#screen_profile").css('display', 'none');
+ $('#loggedInViaSamlSpan').css("display","none");
}
});
})();
\ No newline at end of file |