Commit 0f9ae455 authored by Lukas Haemmerle's avatar Lukas Haemmerle

Fixed bug that prevented IdPs from DiscoFeed to be used for login

parent 69c5d58f
...@@ -85,13 +85,12 @@ function redirectTo(url){ ...@@ -85,13 +85,12 @@ function redirectTo(url){
} }
} }
function submitForm(){ function submitForm(eventObj){
if (document.IdPList.user_idp && document.IdPList.user_idp.selectedIndex == 0){ if (document.IdPList.user_idp && document.IdPList.user_idp.selectedIndex == 0){
alert('<?php echo $makeSelectionString ?>'); alert('<?php echo $makeSelectionString ?>');
return false; return false;
} }
// Set local cookie // Set local cookie
var selectedIdP = document.IdPList.user_idp[document.IdPList.user_idp.selectedIndex].value; var selectedIdP = document.IdPList.user_idp[document.IdPList.user_idp.selectedIndex].value;
setDomainSAMLDomainCookie(selectedIdP); setDomainSAMLDomainCookie(selectedIdP);
...@@ -116,6 +115,9 @@ function submitForm(){ ...@@ -116,6 +115,9 @@ function submitForm(){
redirect_url += getGETArgumentSeparator(redirect_url) + 'target=' + encodeURIComponent(wayf_return_url); redirect_url += getGETArgumentSeparator(redirect_url) + 'target=' + encodeURIComponent(wayf_return_url);
} }
// Prevent default submit action
eventObj.preventDefault();
// Append selected Identity Provider // Append selected Identity Provider
redirect_url += '&entityID=' + encodeURIComponent(selectedIdP); redirect_url += '&entityID=' + encodeURIComponent(selectedIdP);
...@@ -125,6 +127,9 @@ function submitForm(){ ...@@ -125,6 +127,9 @@ function submitForm(){
+ encodeURIComponent(selectedIdP) + encodeURIComponent(selectedIdP)
+ '&target=' + encodeURIComponent(wayf_return_url); + '&target=' + encodeURIComponent(wayf_return_url);
// Prevent default submit action
eventObj.preventDefault();
redirectTo(redirect_url); redirectTo(redirect_url);
} }
...@@ -1290,8 +1295,8 @@ function runImproveDropDown() { ...@@ -1290,8 +1295,8 @@ function runImproveDropDown() {
document.write(wayf_html); document.write(wayf_html);
// Ensure that form submit calls validation function // Ensure that form submit calls validation function
document.getElementById("IdPList").addEventListener("submit", function(){ document.getElementById("IdPList").addEventListener("submit", function(eventObj){
submitForm(); submitForm(eventObj);
}); });
// Load JQuery and improved drop down list code if feature is enabled // Load JQuery and improved drop down list code if feature is enabled
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment