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){
}
}
function submitForm(){
function submitForm(eventObj){
if (document.IdPList.user_idp && document.IdPList.user_idp.selectedIndex == 0){
alert('<?php echo $makeSelectionString ?>');
return false;
}
// Set local cookie
var selectedIdP = document.IdPList.user_idp[document.IdPList.user_idp.selectedIndex].value;
setDomainSAMLDomainCookie(selectedIdP);
......@@ -116,6 +115,9 @@ function submitForm(){
redirect_url += getGETArgumentSeparator(redirect_url) + 'target=' + encodeURIComponent(wayf_return_url);
}
// Prevent default submit action
eventObj.preventDefault();
// Append selected Identity Provider
redirect_url += '&entityID=' + encodeURIComponent(selectedIdP);
......@@ -125,6 +127,9 @@ function submitForm(){
+ encodeURIComponent(selectedIdP)
+ '&target=' + encodeURIComponent(wayf_return_url);
// Prevent default submit action
eventObj.preventDefault();
redirectTo(redirect_url);
}
......@@ -1290,8 +1295,8 @@ function runImproveDropDown() {
document.write(wayf_html);
// Ensure that form submit calls validation function
document.getElementById("IdPList").addEventListener("submit", function(){
submitForm();
document.getElementById("IdPList").addEventListener("submit", function(eventObj){
submitForm(eventObj);
});
// 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