Commit c19f56bf authored by haemmer's avatar haemmer
Browse files

Implemented #849

parent 81f96da8
...@@ -188,25 +188,26 @@ function getDomainNameFromURIHint(){ ...@@ -188,25 +188,26 @@ function getDomainNameFromURIHint(){
global $IDProviders; global $IDProviders;
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); $clientHostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
if ($hostname == $_SERVER['REMOTE_ADDR']){ if ($clientHostname == $_SERVER['REMOTE_ADDR']){
return '-'; return '-';
} }
// Do we still have something // Get domain name from client host name
$domainname = getDomainNameFromURI($hostname); $clientDomainName = getDomainNameFromURI($clientHostname);
if ($domainname != ''){ if ($clientDomainName == ''){
// Find a matching IdP SSO, must be matching the IdP urn
// or at least the last part of the urn
foreach ($IDProviders as $key => $value){
if (preg_match('/'.$domainname.'$/', $key)){
return $key;
}
}
} else {
return '-'; return '-';
} }
// Return first matching IdP entityID that contains the client domain name
foreach ($IDProviders as $key => $value){
if (preg_match('/'.$clientDomainName.'/', $key)){
return $key;
}
}
// No matching entityID was found
return '-';
} }
/******************************************************************************/ /******************************************************************************/
......
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